(idtype, g, norm, weight, bias, out_dim)
| 122 | @pytest.mark.parametrize("bias", [False]) |
| 123 | @pytest.mark.parametrize("out_dim", [1, 2]) |
| 124 | def 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 | |
| 140 | def _S2AXWb(A, N, X, W, b): |
nothing calls this directly
no test coverage detected