MCPcopy Index your code
hub / github.com/dmlc/dgl / test_prop_nodes_bfs

Function test_prop_nodes_bfs

tests/python/common/test_propagate.py:26–36  ·  view source on GitHub ↗
(idtype)

Source from the content-addressed store, hash-verified

24@unittest.skipIf(F._default_context_str == "gpu", reason="GPU not implemented")
25@parametrize_idtype
26def 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")

Callers 1

test_propagate.pyFile · 0.85

Calls 1

create_graphFunction · 0.70

Tested by

no test coverage detected