class_docstr: The Self-Attention Graph Pooling Network with global readout in paper
  `Self Attention Graph Pooling <https://arxiv.org/pdf/1904.08082.pdf>`
  
  Args:
      in_dim (int): The input node feature dimension.
      hid_dim (int): The hidden dimension for node feature.
      out_dim (int): The output dimension.
      num_convs (int, optional): The number of graph convolution layers.
          (default: 3)
      pool_ratio (float, optional): The pool ratio which determines the amount of nodes
          remain after pooling. (default: :obj:`0.5`)
      dropout (float, optional): The dropout ratio for each layer. (default: 0)
class_docstr_tok: ["The","Self-Attention","Graph","Pooling","Network","with","global","readout","in","paper","`","Self","Attention","Graph","Pooling","<","https",":","\/\/arxiv.org\/pdf\/1904.08082.pdf",">","`","Args",":","in_dim","(","int",")",":","The","input","node","feature","dimension",".","hid_dim","(","int",")",":","The","hidden","dimension","for","node","feature",".","out_dim","(","int",")",":","The","output","dimension",".","num_convs","(","int",",","optional",")",":","The","number","of","graph","convolution","layers",".","(","default",":","3",")","pool_ratio","(","float",",","optional",")",":","The","pool","ratio","which","determines","the","amount","of","nodes","remain","after","pooling",".","(","default",":",":","obj",":","`","0.5","`",")","dropout","(","float",",","optional",")",":","The","dropout","ratio","for","each","layer",".","(","default",":","0",")"]
code: def __init__(
      self,
      in_dim: int,
      hid_dim: int,
      out_dim: int,
      num_convs=3,
      pool_ratio: float = 0.5,
      dropout: float = 0.0,
  ):
      super(SAGNetworkGlobal, self).__init__()
      self.dropout = dropout
      self.num_convs = num_convs
  
      convs = []
      for i in range(num_convs):
          _i_dim = in_dim if i == 0 else hid_dim
          _o_dim = hid_dim
          convs.append(GraphConv(_i_dim, _o_dim))
      self.convs = torch.nn.ModuleList(convs)
  
      concat_dim = num_convs * hid_dim
      self.pool = SAGPool(concat_dim, ratio=pool_ratio)
      self.avg_readout = AvgPooling()
      self.max_readout = MaxPooling()
  
      self.lin1 = torch.nn.Linear(concat_dim * 2, hid_dim)
      self.lin2 = torch.nn.Linear(hid_dim, hid_dim // 2)
      self.lin3 = torch.nn.Linear(hid_dim // 2, out_dim)
  
file_path: dgl/examples/pytorch/sagpool/network.py
imports: import dgl
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.nn import AvgPooling, GraphConv, MaxPooling
  from layer import ConvPoolBlock, SAGPool
label_desc: Use image node_id 1 to create a new SAGNetworkGlobal object from inherited base classes: torch.nn with example: obj = SAGNetworkGlobal(in_dim, hid_dim, out_dim, num_convs, pool_ratio, dropout)