Skip to content

Commit

Permalink
Merge pull request #54 from SebastianHurubaru/master
Browse files Browse the repository at this point in the history
Fix for Issue #53
  • Loading branch information
zechengz committed Nov 11, 2023
2 parents 08bab60 + 9a88c43 commit 78dc7d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deepsnap/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1970,9 +1970,9 @@ def pyg_to_graph(
"""
# all fields in PyG Data object
kwargs = {}
kwargs["node_feature"] = data.x if "x" in data.keys else None
kwargs["node_feature"] = data.x if "x" in data.keys() else None
kwargs["edge_feature"] = (
data.edge_attr if "edge_attr" in data.keys else None
data.edge_attr if "edge_attr" in data.keys() else None
)
kwargs["node_label"], kwargs["edge_label"] = None, None
kwargs["graph_feature"], kwargs["graph_label"] = None, None
Expand Down Expand Up @@ -2013,7 +2013,7 @@ def pyg_to_graph(

# include other arguments that are in the kwargs of pyg data object
keys_processed = ["x", "y", "edge_index", "edge_attr"]
for key in data.keys:
for key in data.keys():
if key not in keys_processed:
kwargs[key] = data[key]

Expand Down

0 comments on commit 78dc7d6

Please sign in to comment.