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

Function test_edge_frame

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

Source from the content-addressed store, hash-verified

182
183@parametrize_idtype
184def test_edge_frame(idtype):
185 g = create_graph(idtype, 10)
186 g.add_edges(list(range(10)), list(range(1, 10)) + [0])
187 data = np.random.rand(10, 3)
188 new_data = data.take([0, 1, 2, 7, 8, 9], axis=0)
189 g.edata["h"] = F.tensor(data)
190
191 # remove edges
192 g.remove_edges(range(3, 7))
193 assert F.allclose(g.edata["h"], F.tensor(new_data))
194
195
196@parametrize_idtype

Callers 1

Calls 3

remove_edgesMethod · 0.80
create_graphFunction · 0.70
add_edgesMethod · 0.45

Tested by

no test coverage detected