code: def drop_node(feats, drop_rate, training):
      n = feats.shape[0]
      drop_rates = th.FloatTensor(np.ones(n) * drop_rate)
  
      if training:
          masks = th.bernoulli(1.0 - drop_rates).unsqueeze(1)
          feats = masks.to(feats.device) * feats
  
      else:
          feats = feats * (1.0 - drop_rate)
  
      return feats
  
file_path: dgl/examples/pytorch/grand/model.py
imports: import dgl.function
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 for calling a global function with example usage: drop_node(feats, drop_rate, training) and returns: feats