Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s committed May 17, 2023
1 parent a500a36 commit 2964260
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions torch_geometric/data/hetero_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,20 @@ def fill_dummy_(stores: List[BaseStorage],

def _consistent_size(stores: List[BaseStorage]) -> List[str]:
sizes_dict = get_sizes(stores)
return [
key for key, sizes in sizes_dict.items()
if len(sizes) == len(stores)
]
keys = []
for key, sizes in sizes_dict.items():
# The attribute needs to exist in all types:
if len(sizes) != len(stores):
continue
# The attributes needs to have the same number of dimensions:
lengths = set([len(size) for size in sizes])
if len(lengths) != 1:
continue
# The attributes needs to have the same size in all dimensions:
if len(sizes[0]) != 1 and len(set(sizes)) != 1:
continue
keys.append(key)
return keys

if dummy_values:
self = copy.copy(self)
Expand Down

0 comments on commit 2964260

Please sign in to comment.