(g, idtype)
| 400 | @parametrize_idtype |
| 401 | @pytest.mark.parametrize("g", get_cases(["homo-zero-degree"])) |
| 402 | def test_mean_zero_degree(g, idtype): |
| 403 | g = g.astype(idtype).to(F.ctx()) |
| 404 | g.ndata["h"] = F.ones((g.num_nodes(), 3)) |
| 405 | g.update_all(fn.copy_u("h", "m"), fn.mean("m", "x")) |
| 406 | deg = F.asnumpy(g.in_degrees()) |
| 407 | v = F.tensor(np.where(deg == 0)[0]) |
| 408 | assert F.allclose(F.gather_row(g.ndata["x"], v), F.zeros((len(v), 3))) |
| 409 | |
| 410 | |
| 411 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected