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

Function read_orig_ids

tests/tools/test_dist_part.py:278–288  ·  view source on GitHub ↗
(fname)

Source from the content-addressed store, hash-verified

276
277 # read original node/edge IDs
278 def read_orig_ids(fname):
279 orig_ids = {}
280 for i in range(num_parts):
281 ids_path = os.path.join(out_dir, f"part{i}", fname)
282 part_ids = load_tensors(ids_path)
283 for type, data in part_ids.items():
284 if type not in orig_ids:
285 orig_ids[type] = data
286 else:
287 orig_ids[type] = torch.cat((orig_ids[type], data))
288 return orig_ids
289
290 orig_nids = read_orig_ids("orig_nids.dgl")
291 orig_eids = read_orig_ids("orig_eids.dgl")

Callers 1

_test_pipelineFunction · 0.70

Calls 3

load_tensorsFunction · 0.85
joinMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected