-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
GraphStore
: Data
, HeteroData
respect is_sorted
#4922
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4922 +/- ##
=======================================
Coverage 82.71% 82.71%
=======================================
Files 330 330
Lines 17857 17870 +13
=======================================
+ Hits 14770 14781 +11
- Misses 3087 3089 +2
Continue to review full report at Codecov.
|
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 might be missing information here. Why would we want to allow override of is_sorted
? IMO, one should take care of correctly inserting COO
representation in the first place.
…ometric into gs_respect_is_sorted
GraphStore
: respect NeighborLoader
is_sorted
overrideGraphStore
: Data
, HeteroData
respect is_sorted
@rusty1s this is now updated to have |
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.
Approving to unblock, but I have some questions in the comments below on handling edge_attr
in (Data
+ HeteroData
).
torch_geometric/data/data.py
Outdated
@@ -842,6 +842,9 @@ def _put_edge_index(self, edge_index: EdgeTensorType, | |||
attr_val = edge_tensor_type_to_adj_type(edge_attr, edge_index) | |||
setattr(self, attr_name, attr_val) | |||
|
|||
# Set edge attributes: | |||
setattr(self, f'{attr_name}_edge_attr', edge_attr) |
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.
Also set size
of edge_attr
(if not specified). WDYT?
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.
Not sure I understand: why would it be useful to set the size of EdgeAttr
here? We set the size of the Data
object if it's provided in edge_attr
, and when we get_all_edge_attrs
we return this size as well.
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.
Then I think we need some clarity on what we actually want to save in EdgeAttr
- I was under the impression that all its information is useful to maintain. If the EdgeAttr
does not define size
, we can set it based on self.num_nodes
.
@mananshah99 My main confusion is probably that |
@rusty1s that's a fair point, you are right that currently |
Allows
NeighborLoader
csc()
conversion withGraphStore
to respectis_sorted
ifGraphStore
is aData
orHeteroData
object.