code: def test_graph_conv(idtype, out_dim):
      g = dgl.from_networkx(nx.path_graph(3))
      g = g.astype(idtype).to(F.ctx())
      ctx = F.ctx()
      adj = g.adj_external(transpose=True, ctx=ctx)
  
      conv = nn.GraphConv(5, out_dim, norm="none", bias=True)
      conv.initialize(ctx=ctx)
      # test#1: basic
      h0 = F.ones((3, 5))
      h1 = conv(g, h0)
      assert len(g.ndata) == 0
      assert len(g.edata) == 0
      check_close(h1, _AXWb(adj, h0, conv.weight, conv.bias))
      # test#2: more-dim
      h0 = F.ones((3, 5, 5))
      h1 = conv(g, h0)
      assert len(g.ndata) == 0
      assert len(g.edata) == 0
      check_close(h1, _AXWb(adj, h0, conv.weight, conv.bias))
  
      conv = nn.GraphConv(5, out_dim)
      conv.initialize(ctx=ctx)
  
      # test#3: basic
      h0 = F.ones((3, 5))
      h1 = conv(g, h0)
      assert len(g.ndata) == 0
      assert len(g.edata) == 0
      # test#4: basic
      h0 = F.ones((3, 5, 5))
      h1 = conv(g, h0)
      assert len(g.ndata) == 0
      assert len(g.edata) == 0
  
      conv = nn.GraphConv(5, out_dim)
      conv.initialize(ctx=ctx)
  
      with autograd.train_mode():
          # test#3: basic
          h0 = F.ones((3, 5))
          h1 = conv(g, h0)
          assert len(g.ndata) == 0
          assert len(g.edata) == 0
          # test#4: basic
          h0 = F.ones((3, 5, 5))
          h1 = conv(g, h0)
          assert len(g.ndata) == 0
          assert len(g.edata) == 0
  
      # test not override features
      g.ndata["h"] = 2 * F.ones((3, 1))
      h1 = conv(g, h0)
      assert len(g.ndata) == 1
      assert len(g.edata) == 0
      assert "h" in g.ndata
      check_close(g.ndata["h"], 2 * F.ones((3, 1)))
  
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 3 for calling a global function with example usage: test_graph_conv(idtype, out_dim) without return types