"scripts/deprecated/test_httpserver_decode_stream.py" did not exist on "3842eba5fa305edfc2c66f82e8389d72784d5911"
Unverified Commit e156331b authored by chwan-rice's avatar chwan-rice Committed by GitHub
Browse files

return a list of ntypes/etypes (#2742)


Co-authored-by: default avatarDa Zheng <zhengda1936@gmail.com>
parent 85231dc9
......@@ -113,6 +113,7 @@ def load_partition(part_config, part_id):
assert EID in graph.edata, "the partition graph should contain edge mapping to global edge ID"
gpb, graph_name, ntypes, etypes = load_partition_book(part_config, part_id, graph)
ntypes_list, etypes_list = [], []
for ntype in ntypes:
ntype_id = ntypes[ntype]
# graph.ndata[NID] are global homogeneous node IDs.
......@@ -122,6 +123,7 @@ def load_partition(part_config, part_id):
partids2 = gpb.nid2partid(per_type_nids, ntype)
assert np.all(F.asnumpy(partids1 == part_id)), 'load a wrong partition'
assert np.all(F.asnumpy(partids2 == part_id)), 'load a wrong partition'
ntypes_list.append(ntype)
for etype in etypes:
etype_id = etypes[etype]
# graph.edata[EID] are global homogeneous edge IDs.
......@@ -131,7 +133,8 @@ def load_partition(part_config, part_id):
partids2 = gpb.eid2partid(per_type_eids, etype)
assert np.all(F.asnumpy(partids1 == part_id)), 'load a wrong partition'
assert np.all(F.asnumpy(partids2 == part_id)), 'load a wrong partition'
return graph, node_feats, edge_feats, gpb, graph_name, ntypes, etypes
etypes_list.append(etype)
return graph, node_feats, edge_feats, gpb, graph_name, ntypes_list, etypes_list
def load_partition_book(part_config, part_id, graph=None):
''' Load a graph partition book from the partition config file.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment