MCPcopy
hub / github.com/dmlc/dgl / test_graph_conv2_bi

Function test_graph_conv2_bi

tests/python/mxnet/test_nn.py:124–137  ·  view source on GitHub ↗
(idtype, g, norm, weight, bias, out_dim)

Source from the content-addressed store, hash-verified

122@pytest.mark.parametrize("bias", [False])
123@pytest.mark.parametrize("out_dim", [1, 2])
124def test_graph_conv2_bi(idtype, g, norm, weight, bias, out_dim):
125 g = g.astype(idtype).to(F.ctx())
126 conv = nn.GraphConv(5, out_dim, norm=norm, weight=weight, bias=bias)
127 conv.initialize(ctx=F.ctx())
128 ext_w = F.randn((5, out_dim)).as_in_context(F.ctx())
129 nsrc = g.number_of_src_nodes()
130 ndst = g.number_of_dst_nodes()
131 h = F.randn((nsrc, 5)).as_in_context(F.ctx())
132 h_dst = F.randn((ndst, out_dim)).as_in_context(F.ctx())
133 if weight:
134 h_out = conv(g, (h, h_dst))
135 else:
136 h_out = conv(g, (h, h_dst), ext_w)
137 assert h_out.shape == (ndst, out_dim)
138
139
140def _S2AXWb(A, N, X, W, b):

Callers

nothing calls this directly

Calls 5

number_of_src_nodesMethod · 0.80
number_of_dst_nodesMethod · 0.80
toMethod · 0.45
astypeMethod · 0.45
ctxMethod · 0.45

Tested by

no test coverage detected