code: def test_rgcn(O):
      etype = []
      g = dgl.DGLGraph(
          sp.sparse.random(100, 100, density=0.1), readonly=True
      ).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_low = nn.RelGraphConv(I, O, R, "basis", B, low_mem=True)
      rgc_basis_low.weight = rgc_basis.weight
      rgc_basis_low.w_comp = rgc_basis.w_comp
      rgc_basis_low.loop_weight = rgc_basis.loop_weight
      h = tf.random.normal((100, I))
      r = tf.constant(etype)
      h_new = rgc_basis(g, h, r)
      h_new_low = rgc_basis_low(g, h, r)
      assert list(h_new.shape) == [100, O]
      assert list(h_new_low.shape) == [100, O]
      assert F.allclose(h_new, h_new_low)
  
      if O % B == 0:
          rgc_bdd = nn.RelGraphConv(I, O, R, "bdd", B)
          rgc_bdd_low = nn.RelGraphConv(I, O, R, "bdd", B, low_mem=True)
          rgc_bdd_low.weight = rgc_bdd.weight
          rgc_bdd_low.loop_weight = rgc_bdd.loop_weight
          h = tf.random.normal((100, I))
          r = tf.constant(etype)
          h_new = rgc_bdd(g, h, r)
          h_new_low = rgc_bdd_low(g, h, r)
          assert list(h_new.shape) == [100, O]
          assert list(h_new_low.shape) == [100, O]
          assert F.allclose(h_new, h_new_low)
  
      # with norm
      norm = tf.zeros((g.num_edges(), 1))
  
      rgc_basis = nn.RelGraphConv(I, O, R, "basis", B)
      rgc_basis_low = nn.RelGraphConv(I, O, R, "basis", B, low_mem=True)
      rgc_basis_low.weight = rgc_basis.weight
      rgc_basis_low.w_comp = rgc_basis.w_comp
      rgc_basis_low.loop_weight = rgc_basis.loop_weight
      h = tf.random.normal((100, I))
      r = tf.constant(etype)
      h_new = rgc_basis(g, h, r, norm)
      h_new_low = rgc_basis_low(g, h, r, norm)
      assert list(h_new.shape) == [100, O]
      assert list(h_new_low.shape) == [100, O]
      assert F.allclose(h_new, h_new_low)
  
      if O % B == 0:
          rgc_bdd = nn.RelGraphConv(I, O, R, "bdd", B)
          rgc_bdd_low = nn.RelGraphConv(I, O, R, "bdd", B, low_mem=True)
          rgc_bdd_low.weight = rgc_bdd.weight
          rgc_bdd_low.loop_weight = rgc_bdd.loop_weight
          h = tf.random.normal((100, I))
          r = tf.constant(etype)
          h_new = rgc_bdd(g, h, r, norm)
          h_new_low = rgc_bdd_low(g, h, r, norm)
          assert list(h_new.shape) == [100, O]
          assert list(h_new_low.shape) == [100, O]
          assert F.allclose(h_new, h_new_low)
  
      # id input
      rgc_basis = nn.RelGraphConv(I, O, R, "basis", B)
      rgc_basis_low = nn.RelGraphConv(I, O, R, "basis", B, low_mem=True)
      rgc_basis_low.weight = rgc_basis.weight
      rgc_basis_low.w_comp = rgc_basis.w_comp
      rgc_basis_low.loop_weight = rgc_basis.loop_weight
      h = tf.constant(np.random.randint(0, I, (100,))) * 1
      r = tf.constant(etype) * 1
      h_new = rgc_basis(g, h, r)
      h_new_low = rgc_basis_low(g, h, r)
      assert list(h_new.shape) == [100, O]
      assert list(h_new_low.shape) == [100, O]
      assert F.allclose(h_new, h_new_low)
  
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 7 for calling a global function with example usage: test_rgcn(O) without return types