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 __init__(
      self,
      in_dim: int,
      ratio=0.5,
      conv_op=GraphConv,
      non_linearity=torch.tanh,
  ):
      super(SAGPool, self).__init__()
      self.in_dim = in_dim
      self.ratio = ratio
      self.score_layer = conv_op(in_dim, 1)
      self.non_linearity = non_linearity
  
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 1 to create a new SAGPool object from inherited base classes: torch.nn with example: obj = SAGPool(in_dim, ratio, conv_op, non_linearity)