MCPcopy
hub / github.com/dmlc/dgl / test_subgraph_message_passing

Function test_subgraph_message_passing

tests/python/common/test_subgraph.py:621–629  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

619
620
621def test_subgraph_message_passing():
622 # Unit test for PR #2055
623 g = dgl.graph(([0, 1, 2], [2, 3, 4])).to(F.cpu())
624 g.ndata["x"] = F.copy_to(F.randn((5, 6)), F.cpu())
625 sg = g.subgraph([1, 2, 3]).to(F.ctx())
626 sg.update_all(
627 lambda edges: {"x": edges.src["x"]},
628 lambda nodes: {"y": F.sum(nodes.mailbox["x"], 1)},
629 )
630
631
632@parametrize_idtype

Callers

nothing calls this directly

Calls 6

update_allMethod · 0.80
toMethod · 0.45
graphMethod · 0.45
cpuMethod · 0.45
copy_toMethod · 0.45
ctxMethod · 0.45

Tested by

no test coverage detected