Skip to content

Commit

Permalink
[Distributed] Fix the path for distributed partitioning. (dmlc#2700)
Browse files Browse the repository at this point in the history
Co-authored-by: Ubuntu <[email protected]>
  • Loading branch information
zheng-da and Ubuntu authored Feb 25, 2021
1 parent 7ab3d99 commit 0526b88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/pytorch/rgcn/experimental/get_mag_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
for name in hg.nodes[ntype].data:
node_data[ntype + '/' + name] = hg.nodes[ntype].data[name][local_nodes]
print('node features:', node_data.keys())
dgl.data.utils.save_tensors(metadata['part-{}'.format(part_id)]['node_feats'], node_data)
dgl.data.utils.save_tensors('outputs/' + metadata['part-{}'.format(part_id)]['node_feats'], node_data)

edge_data = {}
for etype in hg.etypes:
local_edges = subg.edata['orig_id'][subg.edata[dgl.ETYPE] == hg.get_etype_id(etype)]
for name in hg.edges[etype].data:
edge_data[etype + '/' + name] = hg.edges[etype].data[name][local_edges]
print('edge features:', edge_data.keys())
dgl.data.utils.save_tensors(metadata['part-{}'.format(part_id)]['edge_feats'], edge_data)
dgl.data.utils.save_tensors('outputs/' + metadata['part-{}'.format(part_id)]['edge_feats'], edge_data)
2 changes: 1 addition & 1 deletion tools/convert_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def read_feats(file_name):
'etypes': etypes_map}

for part_id in range(num_parts):
part_dir = output_dir + '/part' + str(part_id)
part_dir = 'part' + str(part_id)
node_feat_file = os.path.join(part_dir, "node_feat.dgl")
edge_feat_file = os.path.join(part_dir, "edge_feat.dgl")
part_graph_file = os.path.join(part_dir, "graph.dgl")
Expand Down

0 comments on commit 0526b88

Please sign in to comment.