class_docstr: A plain python object modeling a single graph with various
  (optional) attributes:
  
  Args:
      x (Tensor, optional): Node feature matrix with shape :obj:`[num_nodes,
          num_node_features]`. (default: :obj:`None`)
      edge_index (LongTensor, optional): Graph connectivity in COO format
          with shape :obj:`[2, num_edges]`. (default: :obj:`None`)
      edge_attr (Tensor, optional): Edge feature matrix with shape
          :obj:`[num_edges, num_edge_features]`. (default: :obj:`None`)
      y (Tensor, optional): Graph or node targets with arbitrary shape.
          (default: :obj:`None`)
      pos (Tensor, optional): Node position matrix with shape
          :obj:`[num_nodes, num_dimensions]`. (default: :obj:`None`)
  
  The data object is not restricted to these attributes and can be extented
  by any other additional data.
docstr: If the data uses id of nodes for train/val/test, return the splits with specific ratio.
  
  Parameters
  ----------
  train_ratio : float
      the portion of data that used for training.
  
  val_ratio : float
      the portion of data that used for validation.
  
  seed : int
      random seed for splitting dataset.
docstr_tok: ["If","the","data","uses","id","of","nodes","for","train\/val\/test",",","return","the","splits","with","specific","ratio",".","Parameters","--","--","--","--","--","train_ratio",":","float","the","portion","of","data","that","used","for","training",".","val_ratio",":","float","the","portion","of","data","that","used","for","validation",".","seed",":","int","random","seed","for","splitting","dataset","."]
code: def random_splits_nodes(self, train_ratio, val_ratio, seed=None):
      r"""If the data uses id of nodes for train/val/test, return the splits with specific ratio.
  
      Parameters
      ----------
      train_ratio : float
          the portion of data that used for training.
  
      val_ratio : float
          the portion of data that used for validation.
  
      seed : int
          random seed for splitting dataset.
      """
      rs = torch.get_rng_state()
      rs_cuda = torch.cuda.get_rng_state()
      if seed is not None:
          torch.manual_seed(seed)
          torch.cuda.manual_seed(seed)
  
      perm = torch.randperm(self.num_nodes)
      self.train_node = perm[: int(self.num_nodes * train_ratio)]
      self.val_node = perm[
          int(self.num_nodes * train_ratio) : int(
              self.num_nodes * (train_ratio + val_ratio)
          )
      ]
      self.test_node = perm[
          int(self.num_nodes * (train_ratio + val_ratio)) :
      ]
      self.train_target = self.y[self.train_node]
      self.valid_target = self.y[self.valid_node]
      self.test_target = self.y[self.test_node]
  
      torch.set_rng_state(rs)
      torch.cuda.set_rng_state(rs_cuda)
      return self
  
imports: import re
  import torch
label_desc: Use image node_id 13 for calling the Data obj's underlying member method code with example usage: obj.random_splits_nodes(train_ratio, val_ratio, seed) and returns: self