-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GlobalSortAggr
to nn.aggr
package.
#4957
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks amazing. If possible, let's deprecate the corresponding function in torch_geometric.nn.glob
in this PR as well.
Co-authored-by: Matthias Fey <matthias.fey@tu-dortmund.de>
Makes sense. Will add it to the list. Do you mean to apply a depreciated tag or to remove it from the rest of the codebase? (maybe these two can be done separately?) |
for more information, see https://pre-commit.ci
GlobalSortAggr
to nn.aggr
package.GlobalSortAggr
to nn.aggr
package.
d4b52b3
to
6ac56fd
Compare
Not sure why I'm getting failures in the |
torch_geometric/nn/glob/__init__.py
Outdated
global_sort_pool = deprecated( | ||
details="use 'nn.aggr.GlobalSortAggr' instead", | ||
func_name='nn.glob.global_sort_pool', | ||
)(sort.global_sort_pool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cannot use the new class here as its not a replacement (new class doesn't take k
in the function call)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could make it a kwarg if we want it to work exactly the same way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just define it here:
@deprecated(...)
def global_sort_pool(...):
module = GlobalSortAggr(...)
return module(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah okay this is a better solution, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the issue with failing tests is that there exists multiple test_sort.py
files (which is not allowed by pytest
). Try removing glob/aggr/test_sort.py
.
torch_geometric/nn/glob/__init__.py
Outdated
global_sort_pool = deprecated( | ||
details="use 'nn.aggr.GlobalSortAggr' instead", | ||
func_name='nn.glob.global_sort_pool', | ||
)(sort.global_sort_pool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just define it here:
@deprecated(...)
def global_sort_pool(...):
module = GlobalSortAggr(...)
return module(...)
Codecov Report
@@ Coverage Diff @@
## master #4957 +/- ##
=======================================
Coverage 82.79% 82.79%
=======================================
Files 330 330
Lines 17991 18004 +13
=======================================
+ Hits 14896 14907 +11
- Misses 3095 3097 +2
Continue to review full report at Codecov.
|
bdb262c
to
558d1ce
Compare
thanks, I'd not have found that without a lot of pain 😓 (sorry about the force push, had a local conflict that was giving me a lot of trouble) |
Looks okay now. May as well remove the old version at this point. WDYT? |
Yes, please remove it :) |
All done :-) |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @Padarn. LGTM!
nit-pick comment: I think it may be better to rename |
I agree @lightaime! So: #5085 |
Add
GlobalSortAggr
to the newnn.aggr
packages replace existingglobal_sort_pool
fromnn.glob.sort
.Addresses item in #4712
WIP items to address:
dim_size
is not checked or useddim
is not yet respected # skipping as to_dense_batch does not support this yetnn.glob
version (replace it in existing implementations?)