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

Function test_load_old_files1

tests/python/common/data/test_serialize.py:194–207  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

192
193
194def test_load_old_files1():
195 loadg_list, _ = load_old_files("data/1.bin")
196 idx, num_nodes, edge0, edge1, edata_e1, edata_e2, ndata_n1 = np.load(
197 os.path.join(os.path.dirname(__file__), "data/1.npy"), allow_pickle=True
198 )
199
200 load_g = loadg_list[idx]
201 load_edges = load_g.all_edges("uv", "eid")
202
203 assert np.allclose(F.asnumpy(load_edges[0]), edge0)
204 assert np.allclose(F.asnumpy(load_edges[1]), edge1)
205 assert np.allclose(F.asnumpy(load_g.edata["e1"]), edata_e1)
206 assert np.allclose(F.asnumpy(load_g.edata["e2"]), edata_e2)
207 assert np.allclose(F.asnumpy(load_g.ndata["n1"]), ndata_n1)
208
209
210def test_load_old_files2():

Callers

nothing calls this directly

Calls 5

load_old_filesFunction · 0.85
all_edgesMethod · 0.80
asnumpyMethod · 0.80
loadMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected