class_docstr: Implementation of Graph Global Pooling "GlobalAttention"
      
  Reference Paper: Gated Graph Sequence Neural Networks.
  
  Args:
      gate: a neural network that mapping input \in [-1, channels] to output \in [-1, 1]
      nn: a neural network that mapping input \in [-1, in_channels] to output \in [-1, out_channels]. Default:None
class_docstr_tok: ["Implementation","of","Graph","Global","Pooling","``","GlobalAttention","''","Reference","Paper",":","Gated","Graph","Sequence","Neural","Networks",".","Args",":","gate",":","a","neural","network","that","mapping","input","\\in","[","-1",",","channels","]","to","output","\\in","[","-1",",","1","]","nn",":","a","neural","network","that","mapping","input","\\in","[","-1",",","in_channels","]","to","output","\\in","[","-1",",","out_channels","]",".","Default",":","None"]
code: def __init__(self, gate, nn=None):
      super(GlobalAttention, self).__init__()
      self.gate = gate
      self.nn = nn
  
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 1 to create a new GlobalAttention object from inherited base classes: nn with example: obj = GlobalAttention(gate, nn)