Skip to content

Commit

Permalink
Fix ImbalancedSampler on sliced InMemoryDataset (#6374)
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s authored Jan 9, 2023
1 parent 0076734 commit 8e4f967
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added support for dropping nodes in `utils.to_dense_batch` in case `max_num_nodes` is smaller than the number of nodes ([#6124](https://github.com/pyg-team/pytorch_geometric/pull/6124))
- Added the RandLA-Net architecture as an example ([#5117](https://github.com/pyg-team/pytorch_geometric/pull/5117))
### Changed
- Fix `ImbalancedSampler` on sliced `InMemoryDataset` ([#6374](https://github.com/pyg-team/pytorch_geometric/pull/6374))
- Breaking Change: Changed the interface and implementation of `GraphMultisetTransformer` ([#6343](https://github.com/pyg-team/pytorch_geometric/pull/6343))
- Fixed the approximate PPR variant in `transforms.GDC` to not crash on graphs with isolated nodes ([#6242](https://github.com/pyg-team/pytorch_geometric/pull/6242))
- Added a warning when accesing `InMemoryDataset.data` ([#6318](https://github.com/pyg-team/pytorch_geometric/pull/6318))
Expand Down
2 changes: 1 addition & 1 deletion torch_geometric/loader/imbalanced_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(
y = y[input_nodes] if input_nodes is not None else y

elif isinstance(dataset, InMemoryDataset):
y = dataset.data.y.view(-1)
y = dataset.y.view(-1)
assert len(dataset) == y.numel()

else:
Expand Down

0 comments on commit 8e4f967

Please sign in to comment.