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

Function _test_map_to_subgraph

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

Source from the content-addressed store, hash-verified

111
112
113def _test_map_to_subgraph():
114 g = dgl.graph([])
115 g.add_nodes(10)
116 g.add_edges(F.arange(0, 9), F.arange(1, 10))
117 h = g.subgraph([0, 1, 2, 5, 8])
118 v = h.map_to_subgraph_nid([0, 8, 2])
119 assert np.array_equal(F.asnumpy(v), np.array([0, 4, 2]))
120
121
122def create_test_heterograph(idtype):

Callers

nothing calls this directly

Calls 4

asnumpyMethod · 0.80
graphMethod · 0.45
add_nodesMethod · 0.45
add_edgesMethod · 0.45

Tested by

no test coverage detected