(idtype, g, norm, weight, bias, out_dim)
| 99 | @pytest.mark.parametrize("bias", [False]) |
| 100 | @pytest.mark.parametrize("out_dim", [1, 2]) |
| 101 | def test_graph_conv2(idtype, g, norm, weight, bias, out_dim): |
| 102 | g = g.astype(idtype).to(F.ctx()) |
| 103 | conv = nn.GraphConv(5, out_dim, norm=norm, weight=weight, bias=bias) |
| 104 | conv.initialize(ctx=F.ctx()) |
| 105 | ext_w = F.randn((5, out_dim)).as_in_context(F.ctx()) |
| 106 | nsrc = g.number_of_src_nodes() |
| 107 | ndst = g.number_of_dst_nodes() |
| 108 | h = F.randn((nsrc, 5)).as_in_context(F.ctx()) |
| 109 | if weight: |
| 110 | h_out = conv(g, h) |
| 111 | else: |
| 112 | h_out = conv(g, h, ext_w) |
| 113 | assert h_out.shape == (ndst, out_dim) |
| 114 | |
| 115 | |
| 116 | @parametrize_idtype |
nothing calls this directly
no test coverage detected