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

Function test_load_old_files2

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

Source from the content-addressed store, hash-verified

208
209
210def test_load_old_files2():
211 loadg_list, labels0 = load_old_files("data/2.bin")
212 labels1 = load_labels(os.path.join(os.path.dirname(__file__), "data/2.bin"))
213 idx, edges0, edges1, np_labels = np.load(
214 os.path.join(os.path.dirname(__file__), "data/2.npy"), allow_pickle=True
215 )
216 assert np.allclose(F.asnumpy(labels0["label"]), np_labels)
217 assert np.allclose(F.asnumpy(labels1["label"]), np_labels)
218
219 load_g = loadg_list[idx]
220 print(load_g)
221 load_edges = load_g.all_edges("uv", "eid")
222 assert np.allclose(F.asnumpy(load_edges[0]), edges0)
223 assert np.allclose(F.asnumpy(load_edges[1]), edges1)
224
225
226def create_heterographs(idtype):

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected