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

Function test_node_frame

tests/python/common/test_heterograph-remove.py:172–180  ·  view source on GitHub ↗
(idtype)

Source from the content-addressed store, hash-verified

170
171@parametrize_idtype
172def test_node_frame(idtype):
173 g = create_graph(idtype, 10)
174 data = np.random.rand(10, 3)
175 new_data = data.take([0, 1, 2, 7, 8, 9], axis=0)
176 g.ndata["h"] = F.tensor(data)
177
178 # remove nodes
179 g.remove_nodes(range(3, 7))
180 assert F.allclose(g.ndata["h"], F.tensor(new_data))
181
182
183@parametrize_idtype

Callers 1

Calls 2

remove_nodesMethod · 0.80
create_graphFunction · 0.70

Tested by

no test coverage detected