(idtype)
| 1983 | F._default_context_str == "cpu", reason="Need gpu for this test" |
| 1984 | ) |
| 1985 | def test_more_nnz(idtype): |
| 1986 | g = dgl.graph( |
| 1987 | ([0, 0, 0, 0, 0], [1, 1, 1, 1, 1]), idtype=idtype, device=F.ctx() |
| 1988 | ) |
| 1989 | g.ndata["x"] = F.copy_to(F.ones((2, 5)), ctx=F.ctx()) |
| 1990 | g.update_all(fn.copy_u("x", "m"), fn.sum("m", "y")) |
| 1991 | y = g.ndata["y"] |
| 1992 | ans = np.zeros((2, 5)) |
| 1993 | ans[1] = 5 |
| 1994 | ans = F.copy_to(F.tensor(ans, dtype=F.dtype(y)), ctx=F.ctx()) |
| 1995 | assert F.array_equal(y, ans) |
| 1996 | |
| 1997 | |
| 1998 | @parametrize_idtype |
nothing calls this directly
no test coverage detected