code: def test_rgcn(O):
      ctx = F.ctx()
      etype = []
      g = dgl.from_scipy(sp.sparse.random(100, 100, density=0.1)).to(
          F.ctx()
      )
      # 5 etypes
      R = 5
      for i in range(g.num_edges()):
          etype.append(i % 5)
      B = 2
      I = 10
  
      rgc_basis = nn.RelGraphConv(I, O, R, "basis", B)
      rgc_basis.initialize(ctx=ctx)
      h = nd.random.randn(100, I, ctx=ctx)
      r = nd.array(etype, ctx=ctx)
      h_new = rgc_basis(g, h, r)
      assert list(h_new.shape) == [100, O]
  
      if O % B == 0:
          rgc_bdd = nn.RelGraphConv(I, O, R, "bdd", B)
          rgc_bdd.initialize(ctx=ctx)
          h = nd.random.randn(100, I, ctx=ctx)
          r = nd.array(etype, ctx=ctx)
          h_new = rgc_bdd(g, h, r)
          assert list(h_new.shape) == [100, O]
  
      # with norm
      norm = nd.zeros((g.num_edges(), 1), ctx=ctx)
  
      rgc_basis = nn.RelGraphConv(I, O, R, "basis", B)
      rgc_basis.initialize(ctx=ctx)
      h = nd.random.randn(100, I, ctx=ctx)
      r = nd.array(etype, ctx=ctx)
      h_new = rgc_basis(g, h, r, norm)
      assert list(h_new.shape) == [100, O]
  
      if O % B == 0:
          rgc_bdd = nn.RelGraphConv(I, O, R, "bdd", B)
          rgc_bdd.initialize(ctx=ctx)
          h = nd.random.randn(100, I, ctx=ctx)
          r = nd.array(etype, ctx=ctx)
          h_new = rgc_bdd(g, h, r, norm)
          assert list(h_new.shape) == [100, O]
  
      # id input
      rgc_basis = nn.RelGraphConv(I, O, R, "basis", B)
      rgc_basis.initialize(ctx=ctx)
      h = nd.random.randint(0, I, (100,), ctx=ctx)
      r = nd.array(etype, ctx=ctx)
      h_new = rgc_basis(g, h, r)
      assert list(h_new.shape) == [100, O]
  
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 33 for calling a global function with example usage: test_rgcn(O) without return types