pytorch_geometric icon indicating copy to clipboard operation
pytorch_geometric copied to clipboard

Add `reverse` support in `aggregation_resolver`

Open lightaime opened this issue 2 years ago • 4 comments

This PR added the reverse support in aggregation_resolver to resolve Aggregation to strings. This will keep message_and_aggregate functionality intact if an aggr is FUSE_AGGRS but passed with Aggregation instance.

Addresses https://github.com/pyg-team/pytorch_geometric/issues/4712.

lightaime avatar Jul 28 '22 23:07 lightaime

Codecov Report

Merging #5084 (1b132c1) into master (412ae53) will decrease coverage by 1.88%. The diff coverage is 83.87%.

@@            Coverage Diff             @@
##           master    #5084      +/-   ##
==========================================
- Coverage   84.86%   82.97%   -1.89%     
==========================================
  Files         332      332              
  Lines       18304    18324      +20     
==========================================
- Hits        15534    15205     -329     
- Misses       2770     3119     +349     
Impacted Files Coverage Δ
torch_geometric/nn/conv/message_passing.py 98.84% <75.00%> (+<0.01%) :arrow_up:
torch_geometric/nn/resolver.py 87.67% <85.18%> (-6.33%) :arrow_down:
torch_geometric/nn/models/dimenet_utils.py 0.00% <0.00%> (-75.52%) :arrow_down:
torch_geometric/nn/models/dimenet.py 14.51% <0.00%> (-53.00%) :arrow_down:
torch_geometric/nn/conv/utils/typing.py 81.25% <0.00%> (-17.50%) :arrow_down:
torch_geometric/profile/profile.py 32.94% <0.00%> (-15.30%) :arrow_down:
torch_geometric/nn/inits.py 67.85% <0.00%> (-7.15%) :arrow_down:
torch_geometric/transforms/add_self_loops.py 94.44% <0.00%> (-5.56%) :arrow_down:
torch_geometric/io/tu.py 93.90% <0.00%> (-2.44%) :arrow_down:
... and 10 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

codecov[bot] avatar Jul 28 '22 23:07 codecov[bot]

This seems important, but I wonder if we could just define the equivalent aggregation on the aggregation class itself.

class SomeAggregation:
    @property
    def resolve_str():
        return "some_aggregation"

Not sure if its better. Just a thoguht.

Padarn avatar Jul 29 '22 00:07 Padarn

This seems important, but I wonder if we could just define the equivalent aggregation on the aggregation class itself.

class SomeAggregation:
    @property
    def resolve_str():
        return "some_aggregation"

Not sure if its better. Just a thoguht.

Thanks for the suggestion. I am open to this solution as well.

lightaime avatar Jul 29 '22 15:07 lightaime

Sorry for the delay in review.

rusty1s avatar Aug 05 '22 07:08 rusty1s