MCPcopy Create free account
hub / github.com/dmlc/dgl / test_issue_2484

Function test_issue_2484

tests/python/common/function/test_basics.py:785–798  ·  view source on GitHub ↗
(idtype)

Source from the content-addressed store, hash-verified

783
784@parametrize_idtype
785def test_issue_2484(idtype):
786 import dgl.function as fn
787
788 g = dgl.graph(([0, 1, 2], [1, 2, 3]), idtype=idtype, device=F.ctx())
789 x = F.copy_to(F.randn((4,)), F.ctx())
790 g.ndata["x"] = x
791 g.pull([2, 1], fn.u_add_v("x", "x", "m"), fn.sum("m", "x"))
792 y1 = g.ndata["x"]
793
794 g.ndata["x"] = x
795 g.pull([1, 2], fn.u_add_v("x", "x", "m"), fn.sum("m", "x"))
796 y2 = g.ndata["x"]
797
798 assert F.allclose(y1, y2)

Callers

nothing calls this directly

Calls 4

graphMethod · 0.45
ctxMethod · 0.45
copy_toMethod · 0.45
pullMethod · 0.45

Tested by

no test coverage detected