class_docstr: Implementation of Graph Multiset Transformer pooling operator
  Referenced from: Accurate Learning of Graph Representations
  with Graph Multiset Pooling
  
  Args:
      input_dim: The size of input feature
      hidden_dim: The number of hidden units.
      output_dim: The size of output feature.
      conv: A graph convolution layer. Default: pgl.nn.GCNCONV
      num_nodes: The number of average nodes.
      pooling_ratio: The pooling ratio of GMPool. Default: 0.25
      pool_sequences: A str list that contains the blocks refered in GMT paper.
                      Default`["GMPool_G", "SelfAtt", "GMPool_I"]`)
      num_heads: The number of attention heads. Default: 4
      layer_norm: Wether to use LayerNorm. Default: False
      
docstr: Args:
      graph: "pgl.Graph" instance
      x:  A tensor with shape [num_nodes, input_dim]
  Returned:
      output: the pooled output with shape[1, output_dim]
docstr_tok: ["Args",":","graph",":","``","pgl.Graph","''","instance","x",":","A","tensor","with","shape","[","num_nodes",",","input_dim","]","Returned",":","output",":","the","pooled","output","with","shape","[","1",",","output_dim","]"]
code: def forward(self, graph, x):
      """
      Args:
          graph: "pgl.Graph" instance
          x:  A tensor with shape [num_nodes, input_dim]
      Returned:
          output: the pooled output with shape[1, output_dim]
      """
  
      x = self.lin1(x)
      batch_x, _ = to_dense_batch(x, graph)
      mask = (batch_x.sum(-1) == 0).astype(paddle.int64).unsqueeze(
          0
      ) * -1e9
      for i, (name, pool) in enumerate(
          zip(self.pool_sequences, self.pools)
      ):
          g = (graph, x) if name == "GMPool_G" else None
          batch_x = pool(batch_x, g, mask)
          mask = None
      output = self.lin2(batch_x.squeeze(1))
      return output
  
imports: import paddle
  import paddle.nn
  import math
  import paddle.nn.functional
  import pgl
  from pgl.utils.transform import to_dense_batch
label_desc: Use image node_id 2 for calling the GraphMultisetTransformer obj's underlying member method code with example usage: obj.forward(graph, x) and returns: output