Skip to content

Commit

Permalink
Render set attributes in str(data) correctly (#9498)
Browse files Browse the repository at this point in the history
…uence

---------

Co-authored-by: rusty1s <matthias.fey@tu-dortmund.de>
  • Loading branch information
hnsgrvr and rusty1s authored Jul 29, 2024
1 parent 09c1831 commit 4e878d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch_geometric/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ def size_repr(key: Any, value: Any, indent: int = 0) -> str:
f'[{value.num_rows}, {value.num_cols}])')
elif isinstance(value, str):
out = f"'{value}'"
elif isinstance(value, Sequence):
elif isinstance(value, (Sequence, set)):
out = str([len(value)])
elif isinstance(value, Mapping) and len(value) == 0:
out = '{}'
Expand Down

0 comments on commit 4e878d1

Please sign in to comment.