class_docstr: Uniformly node dropping on the given graph or batched graphs. 
  Class objects callable via method :meth:`views_fn`.
  
  Args:
      ratio (float, optinal): Ratio of nodes to be dropped. (default: :obj:`0.1`)
code: def do_trans(self, data):
      node_num, _ = data.x.size()
      device = data.x.device
      _, edge_num = data.edge_index.size()
  
      keep_num = int(node_num * (1 - self.ratio))
      idx_nondrop = torch.randperm(node_num, device=device)[:keep_num]
      mask_nondrop = (
          torch.zeros_like(data.x[:, 0])
          .scatter_(0, idx_nondrop, 1.0)
          .bool()
      )
  
      edge_index, _ = subgraph(
          mask_nondrop,
          data.edge_index,
          relabel_nodes=True,
          num_nodes=node_num,
      )
      return Data(x=data.x[mask_nondrop], edge_index=edge_index)
  
file_path: DIG/dig/sslgraph/method/contrastive/views_fn/sample.py
imports: import torch
  import numpy
  from torch_geometric.utils import to_dense_adj, dense_to_sparse, subgraph
  from torch_geometric.data import Batch, Data
label_desc: Use image node_id 3 for calling the UniformSample obj's underlying member method code with example usage: obj.do_trans(data) and returns: Data