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

Function test_line_graph1

tests/python/common/transforms/test_transform.py:130–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128
129
130def test_line_graph1():
131 N = 5
132 G = dgl.from_networkx(nx.star_graph(N)).to(F.ctx())
133 G.edata["h"] = F.randn((2 * N, D))
134 L = G.line_graph(shared=True)
135 assert L.num_nodes() == 2 * N
136 assert F.allclose(L.ndata["h"], G.edata["h"])
137 assert G.device == F.ctx()
138
139
140@parametrize_idtype

Callers

nothing calls this directly

Calls 4

line_graphMethod · 0.80
toMethod · 0.45
ctxMethod · 0.45
num_nodesMethod · 0.45

Tested by

no test coverage detected