-
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
Avoid a graph break in ModuleDict
and ParameterDict
#8363
Conversation
for more information, see https://pre-commit.ci
torc_geometric.nn.module_dict.ModuleDict
torc_geometric.nn.module_dict.ModuleDict
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8363 +/- ##
==========================================
- Coverage 88.80% 88.41% -0.39%
==========================================
Files 475 475
Lines 28841 28838 -3
==========================================
- Hits 25611 25497 -114
- Misses 3230 3341 +111 ☔ View full report in Codecov by Sentry. |
Converting this to draft as it's currently not a proper fix. |
torc_geometric.nn.module_dict.ModuleDict
ModuleDict
ModuleDict
ModuleDict
and ParameterDict
assert len(key) > 1 | ||
key = f"<{'___'.join(key)}>" | ||
assert isinstance(key, str) | ||
|
||
# ModuleDict cannot handle keys that exists as class attributes: | ||
if hasattr(cls, key): |
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.
For the note, graph breaks produeced by hasattr
here were likely due to pytorch/pytorch#111522.
We have a graph break at
hasattr
call inModuleDict.to_internal_key
.Repro: