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

Function test_edge_conv_bi

tests/python/mxnet/test_nn.py:451–461  ·  view source on GitHub ↗
(g, idtype, out_dim)

Source from the content-addressed store, hash-verified

449@pytest.mark.parametrize("g", get_cases(["bipartite"], exclude=["zero-degree"]))
450@pytest.mark.parametrize("out_dim", [1, 2])
451def test_edge_conv_bi(g, idtype, out_dim):
452 g = g.astype(idtype).to(F.ctx())
453 ctx = F.ctx()
454 edge_conv = nn.EdgeConv(5, out_dim)
455 edge_conv.initialize(ctx=ctx)
456 print(edge_conv)
457 # test #1: basic
458 h0 = F.randn((g.number_of_src_nodes(), 5))
459 x0 = F.randn((g.number_of_dst_nodes(), 5))
460 h1 = edge_conv(g, (h0, x0))
461 assert h1.shape == (g.number_of_dst_nodes(), out_dim)
462
463
464@parametrize_idtype

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