-
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
Properly support dynamic inheritance in Batch
#5051
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5051 +/- ##
==========================================
- Coverage 82.90% 82.89% -0.02%
==========================================
Files 331 331
Lines 18150 18160 +10
==========================================
+ Hits 15048 15053 +5
- Misses 3102 3107 +5
Help us with your feedback. Take ten seconds to tell us how you rate us. |
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.
Amazing, didn’t know it is due to pin_memory
. Can we add a test which might have failed without this patch?
Since this is an issue with |
This diff properly supports dynamic inheritance with the
DynamicInheritance
metaclass inBatch
. The initial issue was that of conflicting metaclasses:abc.ABCMeta
andDynamicInheritance
forData
andHeteroData
objects. The resolution required two steps:pin_memory
in PyTorch which makes assumptions aboutMutableMapping
before checking whetherpin_memory
exists in the class. This in turn had adverse effects of calling the metaclass of the class again when constructing the new class as part ofpin_memory
, which resulted in theDataDataBatch
problem observed in the filed issue.Hopefully the latter fix can be deprecated in the future, with a patch to PyTorch (see pytorch/pytorch#82185)
Closes #4848