code: def test_tagconv(out_dim):
      g = dgl.from_networkx(nx.path_graph(3)).to(F.ctx())
      ctx = F.ctx()
      adj = g.adj_external(transpose=True, ctx=ctx)
      norm = mx.nd.power(g.in_degrees().astype("float32"), -0.5)
  
      conv = nn.TAGConv(5, out_dim, bias=True)
      conv.initialize(ctx=ctx)
      print(conv)
  
      # test#1: basic
      h0 = F.ones((3, 5))
      h1 = conv(g, h0)
      assert len(g.ndata) == 0
      assert len(g.edata) == 0
      shp = norm.shape + (1,) * (h0.ndim - 1)
      norm = norm.reshape(shp).as_in_context(h0.context)
  
      assert F.allclose(
          h1,
          _S2AXWb(
              adj, norm, h0, conv.lin.data(ctx), conv.h_bias.data(ctx)
          ),
      )
  
      conv = nn.TAGConv(5, out_dim)
      conv.initialize(ctx=ctx)
  
      # test#2: basic
      h0 = F.ones((3, 5))
      h1 = conv(g, h0)
      assert h1.shape[-1] == out_dim
  
imports: import backend
  import dgl
  import dgl.function
  import dgl.nn.mxnet
  import mxnet
  import networkx
  import numpy
  import pytest
  import scipy
  from mxnet import autograd, gluon, nd
  from utils import parametrize_idtype
  from utils.graph_cases import get_cases, random_bipartite, random_dglgraph, random_graph
label_desc: Use image node_id 7 for calling a global function with example usage: test_tagconv(out_dim) without return types