-
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
HeteroData.is_undirected()
#4604
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4604 +/- ##
==========================================
+ Coverage 82.80% 82.81% +0.01%
==========================================
Files 315 315
Lines 16599 16605 +6
==========================================
+ Hits 13744 13752 +8
+ Misses 2855 2853 -2
Continue to review full report at Codecov.
|
if len(edge_indices) == 1: # Memory-efficient `torch.cat`: | ||
edge_index = edge_indices[0] | ||
elif len(edge_indices) > 0: | ||
edge_index = torch.cat(edge_indices, dim=-1) |
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.
[naive question] would it be better to cat incrementally in the loop which determines the edge_slices?
Out of scope - but do you think we should somehow cache the result of 'is undirected'? I'm wondering if anyone uses it for example in a forward pass of a model, in which case it'll be a very expensive operation to repeat many times. Maybe that's not something anyone would do though. |
I think that is an interesting idea. One thing that complicates this is that PyG would need to track changes to |
Yeah that is true, invalidating the cache does seem fairly error-prone. It doe seem possible given the I like the idea of something like |
Agree. I think this is an interesting idea that we may want to integrate once we find more use-cases for it :) |
No description provided.