-
Notifications
You must be signed in to change notification settings - Fork 310
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
[REVIEW] Allow passing a dict in feat_name for add_edge_data and add_node_data #2795
[REVIEW] Allow passing a dict in feat_name for add_edge_data and add_node_data #2795
Conversation
feat_name=None, | ||
contains_vector_features=False, | ||
): |
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.
Changed to this to keep the API cleaner and intuitive as you would want to provide feat_name together with contains_vector_features
tensor = tensor.to(device) | ||
else: | ||
return tensor | ||
return tensor |
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.
Fixed an error here when a user provides device, cant test this as that needs Pytorch installed here.
|
||
# Clear properties if set as data has changed | ||
self.__clear_cached_properties() | ||
|
||
def get_node_storage(self, feat_name, ntype=None): | ||
def get_node_storage(self, key, ntype=None, indices_offset=0): |
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.
Changed to key to match DGL.
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.
backend_lib=self.backend_lib, | ||
) | ||
|
||
def get_edge_storage(self, feat_name, etype=None): | ||
def get_edge_storage(self, key, etype=None, indices_offset=0): |
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.
Changed to key to match DGL.
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.
@@ -548,6 +528,7 @@ def __init__(self, pg, columns, storage_type, backend_lib="torch"): | |||
self.storage_type = storage_type | |||
|
|||
self.from_dlpack = from_dlpack | |||
self.indices_offset = indices_offset |
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.
Setting offset makes upstream code cleaner
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## branch-22.12 #2795 +/- ##
===============================================
Coverage ? 60.48%
===============================================
Files ? 111
Lines ? 6526
Branches ? 0
===============================================
Hits ? 3947
Misses ? 2579
Partials ? 0 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@gpucibot rerun tests |
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.
Mostly minor things: some questions, suggestions, typos, etc.
Co-authored-by: Rick Ratzel <[email protected]>
Co-authored-by: Rick Ratzel <[email protected]>
Co-authored-by: Rick Ratzel <[email protected]>
Co-authored-by: Rick Ratzel <[email protected]>
Co-authored-by: Rick Ratzel <[email protected]>
Co-authored-by: Rick Ratzel <[email protected]>
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 @rlratzel , Have addressed your reviews and added comment on the questions. Let me know what else needs to be done.
@gpucibot merge |
@gpucibot merge |
@gpucibot merge |
This PR adds support for dict in feat_name for add_edge_data and add_node_data.
get_feature_storage
bug when device is set