Skip to content
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

Remove adding num_edges directly to store in the Pad transform #6758

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

bwroblew
Copy link
Contributor

Handling num_edges as an attribute requires couple more changes and doesn't work well with the current implementation. For example, when num_edges is set on the Data objects and those objects are merged into a Batch the num_edges attribute is a tensor with values from all the objects. It works well when implemented as a property of EdgeStorage and not as a direct attribute, so removing it for now.

@bwroblew bwroblew force-pushed the remove_num_edges_in_pad branch from 5bd5957 to e85243d Compare February 21, 2023 12:06
@codecov
Copy link

codecov bot commented Feb 21, 2023

Codecov Report

Merging #6758 (5bd5957) into master (e9dc546) will decrease coverage by 1.58%.
The diff coverage is n/a.

❗ Current head 5bd5957 differs from pull request most recent head e85243d. Consider uploading reports for the commit e85243d to get more accurate results

@@            Coverage Diff             @@
##           master    #6758      +/-   ##
==========================================
- Coverage   90.78%   89.21%   -1.58%     
==========================================
  Files         425      425              
  Lines       23152    23113      -39     
==========================================
- Hits        21019    20620     -399     
- Misses       2133     2493     +360     
Impacted Files Coverage Δ
torch_geometric/transforms/pad.py 95.58% <ø> (-0.05%) ⬇️
torch_geometric/nn/models/dimenet_utils.py 0.00% <0.00%> (-75.52%) ⬇️
torch_geometric/nn/models/dimenet.py 17.66% <0.00%> (-49.78%) ⬇️
torch_geometric/visualization/graph.py 68.25% <0.00%> (-26.99%) ⬇️
torch_geometric/nn/conv/utils/typing.py 83.75% <0.00%> (-15.00%) ⬇️
torch_geometric/nn/pool/asap.py 91.89% <0.00%> (-8.11%) ⬇️
torch_geometric/resolver.py 82.75% <0.00%> (-6.90%) ⬇️
torch_geometric/nn/dense/linear.py 88.97% <0.00%> (-5.92%) ⬇️
torch_geometric/nn/models/attentive_fp.py 95.83% <0.00%> (-4.17%) ⬇️
torch_geometric/sampler/neighbor_sampler.py 91.56% <0.00%> (-3.22%) ⬇️
... and 29 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@rusty1s rusty1s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, there is some custom logic in Batch to obtain the real number of nodes, which I assume we would need to copy?

@rusty1s rusty1s enabled auto-merge (squash) February 21, 2023 12:09
@rusty1s rusty1s merged commit 42e8733 into pyg-team:master Feb 21, 2023
@bwroblew
Copy link
Contributor Author

bwroblew commented Feb 21, 2023

Yes, I can work on that later and extend that logic. I guess for now it's not necessary and it was a mistake on my side to set it explicitly.
There are couple of places where num_nodes has a separate logic (for example when creating a subgraph) and similar logic would be probably needed for num_edges.
I guess it's best to remove it now and I can work on that when it's really needed.

@rusty1s rusty1s deleted the remove_num_edges_in_pad branch February 21, 2023 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants