code: def test_glob_att_pool():
      g = dgl.DGLGraph(nx.path_graph(10)).to(F.ctx())
  
      gap = nn.GlobalAttentionPooling(layers.Dense(1), layers.Dense(10))
      print(gap)
  
      # test#1: basic
      h0 = F.randn((g.num_nodes(), 5))
      h1 = gap(g, h0)
      assert h1.shape[0] == 1 and h1.shape[1] == 10 and h1.ndim == 2
  
      # test#2: batched graph
      bg = dgl.batch([g, g, g, g])
      h0 = F.randn((bg.num_nodes(), 5))
      h1 = gap(bg, h0)
      assert h1.shape[0] == 4 and h1.shape[1] == 10 and h1.ndim == 2
  
imports: from copy import deepcopy
  import backend
  import dgl
  import dgl.function
  import dgl.nn.tensorflow
  import networkx
  import numpy
  import pytest
  import scipy
  import tensorflow
  from tensorflow.keras import layers
  from utils import parametrize_idtype
  from utils.graph_cases import get_cases, random_bipartite, random_dglgraph, random_graph
label_desc: Use image node_id 6 for calling a global function with example usage: test_glob_att_pool() without return types