class_docstr: Implementation of Graph Global Pooling "Set2Set".
  
  Reference Paper: ORDER MATTERS: SEQUENCE TO SEQUENCE 
  
  Args:
      input_dim (int): dimentional size of input
      n_iters: number of iteration
      n_layers: number of LSTM layers
  Return:
      output_feat: output feature of set2set pooling with shape [batch, 2*dim].
class_docstr_tok: ["Implementation","of","Graph","Global","Pooling","``","Set2Set","''",".","Reference","Paper",":","ORDER","MATTERS",":","SEQUENCE","TO","SEQUENCE","Args",":","input_dim","(","int",")",":","dimentional","size","of","input","n_iters",":","number","of","iteration","n_layers",":","number","of","LSTM","layers","Return",":","output_feat",":","output","feature","of","set2set","pooling","with","shape","[","batch",",","2","*","dim","]","."]
docstr: Forward function of Graph Global Pooling "Set2Set".
  
  Args:
      graph: the graph object from (:code:`Graph`)
      x: A tensor with shape (num_nodes, feature_size).
  Return:
      output_feat: A tensor with shape (num_nodes, output_size).
docstr_tok: ["Forward","function","of","Graph","Global","Pooling","``","Set2Set","''",".","Args",":","graph",":","the","graph","object","from","(",":","code",":","`","Graph","`",")","x",":","A","tensor","with","shape","(","num_nodes",",","feature_size",")",".","Return",":","output_feat",":","A","tensor","with","shape","(","num_nodes",",","output_size",")","."]
code: def forward(self, graph, x):
      """Forward function of Graph Global Pooling "Set2Set".
  
      Args:
          graph: the graph object from (:code:`Graph`)
          x: A tensor with shape (num_nodes, feature_size).
      Return:
          output_feat: A tensor with shape (num_nodes, output_size).
      """
      graph_id = graph.graph_node_id
      batch_size = graph_id.max() + 1
      h = (
          paddle.zeros((self.n_layers, batch_size, self.input_dim)),
          paddle.zeros((self.n_layers, batch_size, self.input_dim)),
      )
      q_star = paddle.zeros((batch_size, self.output_dim))
      for _ in range(self.n_iters):
          q, h = self.lstm(q_star.unsqueeze(0), h)
          q = q.reshape((batch_size, self.input_dim))
          e = (x * q.index_select(graph_id, axis=0)).sum(
              axis=-1, keepdim=True
          )
          a = segment_softmax(e, graph_id)
          r = segment_sum(a * x, graph_id)
          q_start = paddle.concat([q, r], axis=-1)
  
      return q_start
  
imports: import warnings
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  import pgl
  from pgl.math import segment_sum, segment_softmax, segment_topk, segment_pool
  from pgl.utils.transform import filter_adj
label_desc: Use image node_id 2 for calling the Set2Set obj's underlying member method code with example usage: obj.forward(graph, x) and returns: q_start