"tests/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "95d62394830a8e99ba4c39eae82e5d512485f80d"
Unverified Commit 9a9a06eb authored by 张天启's avatar 张天启 Committed by GitHub
Browse files

[Bug Fix] Fix undefined var bug in LegacyTUDataset (#2543)



* [Bug Fix] Fix undefined var bug in LegacyTUDataset

* upt

* [Bug Fix] Fix cache file name bug in TUDataset
Co-authored-by: default avatarTong He <hetong007@gmail.com>
parent b36b6c26
...@@ -139,10 +139,10 @@ class LegacyTUDataset(DGLBuiltinDataset): ...@@ -139,10 +139,10 @@ class LegacyTUDataset(DGLBuiltinDataset):
if 'feat' not in g.ndata.keys(): if 'feat' not in g.ndata.keys():
for idxs, g in zip(node_idx_list, self.graph_lists): for idxs, g in zip(node_idx_list, self.graph_lists):
g.ndata['feat'] = np.ones((g.number_of_nodes(), hidden_size)) g.ndata['feat'] = np.ones((g.number_of_nodes(), self.hidden_size))
self.data_mode = "constant" self.data_mode = "constant"
if self.verbose: if self.verbose:
print("Use Constant one as Feature with hidden size {}".format(hidden_size)) print("Use Constant one as Feature with hidden size {}".format(self.hidden_size))
# remove graphs that are too large by user given standard # remove graphs that are too large by user given standard
# optional pre-processing steop in conformity with Rex Ying's original # optional pre-processing steop in conformity with Rex Ying's original
...@@ -359,7 +359,7 @@ class TUDataset(DGLBuiltinDataset): ...@@ -359,7 +359,7 @@ class TUDataset(DGLBuiltinDataset):
def has_cache(self): def has_cache(self):
graph_path = os.path.join(self.save_path, 'tu_{}.bin'.format(self.name)) graph_path = os.path.join(self.save_path, 'tu_{}.bin'.format(self.name))
info_path = os.path.join(self.save_path, 'legacy_tu_{}.pkl'.format(self.name)) info_path = os.path.join(self.save_path, 'tu_{}.pkl'.format(self.name))
if os.path.exists(graph_path) and os.path.exists(info_path): if os.path.exists(graph_path) and os.path.exists(info_path):
return True return True
return False return False
......
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