class_docstr: The Self-Attention Pooling layer in paper
  `Self Attention Graph Pooling <https://arxiv.org/pdf/1904.08082.pdf>`
  
  Args:
      in_dim (int): The dimension of node feature.
      ratio (float, optional): The pool ratio which determines the amount of nodes
          remain after pooling. (default: :obj:`0.5`)
      conv_op (torch.nn.Module, optional): The graph convolution layer in dgl used to
      compute scale for each node. (default: :obj:`dgl.nn.GraphConv`)
      non_linearity (Callable, optional): The non-linearity function, a pytorch function.
          (default: :obj:`torch.tanh`)
class_docstr_tok: ["The","Self-Attention","Pooling","layer","in","paper","`","Self","Attention","Graph","Pooling","<","https",":","\/\/arxiv.org\/pdf\/1904.08082.pdf",">","`","Args",":","in_dim","(","int",")",":","The","dimension","of","node","feature",".","ratio","(","float",",","optional",")",":","The","pool","ratio","which","determines","the","amount","of","nodes","remain","after","pooling",".","(","default",":",":","obj",":","`","0.5","`",")","conv_op","(","torch.nn.Module",",","optional",")",":","The","graph","convolution","layer","in","dgl","used","to","compute","scale","for","each","node",".","(","default",":",":","obj",":","`","dgl.nn.GraphConv","`",")","non_linearity","(","Callable",",","optional",")",":","The","non-linearity","function",",","a","pytorch","function",".","(","default",":",":","obj",":","`","torch.tanh","`",")"]
code: def forward(self, graph: dgl.DGLGraph, feature: torch.Tensor):
      score = self.score_layer(graph, feature).squeeze()
      perm, next_batch_num_nodes = topk(
          score,
          self.ratio,
          get_batch_id(graph.batch_num_nodes()),
          graph.batch_num_nodes(),
      )
      feature = feature[perm] * self.non_linearity(score[perm]).view(
          -1, 1
      )
      graph = dgl.node_subgraph(graph, perm)
  
      # node_subgraph currently does not support batch-graph,
      # the 'batch_num_nodes' of the result subgraph is None.
      # So we manually set the 'batch_num_nodes' here.
      # Since global pooling has nothing to do with 'batch_num_edges',
      # we can leave it to be None or unchanged.
      graph.set_batch_num_nodes(next_batch_num_nodes)
  
      return graph, feature, perm
  
file_path: dgl/examples/pytorch/sagpool/layer.py
imports: import dgl
  import torch
  import torch.nn.functional
  from dgl.nn import AvgPooling, GraphConv, MaxPooling
  from utils import get_batch_id, topk
label_desc: Use image node_id 2 for calling the SAGPool obj's underlying member method code with example usage: obj.forward(graph, feature) and returns: graph,  feature,  perm