(idtype)
| 24 | @unittest.skipIf(F._default_context_str == "gpu", reason="GPU not implemented") |
| 25 | @parametrize_idtype |
| 26 | def test_prop_nodes_bfs(idtype): |
| 27 | g = create_graph(idtype) |
| 28 | g.ndata["x"] = F.ones((5, 2)) |
| 29 | dgl.prop_nodes_bfs( |
| 30 | g, 0, message_func=mfunc, reduce_func=rfunc, apply_node_func=None |
| 31 | ) |
| 32 | # pull nodes using bfs order will result in a cumsum[i] + data[i] + data[i+1] |
| 33 | assert F.allclose( |
| 34 | g.ndata["x"], |
| 35 | F.tensor([[2.0, 2.0], [4.0, 4.0], [6.0, 6.0], [8.0, 8.0], [9.0, 9.0]]), |
| 36 | ) |
| 37 | |
| 38 | |
| 39 | @unittest.skipIf(F._default_context_str == "gpu", reason="GPU not implemented") |
no test coverage detected