-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix method stub creation for function attributes #37994
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
Conversation
Before, reassigning a method in a module (like `forward = _forward`) didn't work, because we look at the function object's name for our def name when building AST. Mkae that overrideable to handle cases like reassignment [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit fcaafde (more details on the Dr. CI page):
ci.pytorch.org: 1 failedThis comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker. This comment has been revised 5 times. |
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.
Sounds good, one potential bug
torch/jit/frontend.py
Outdated
|
||
|
||
def get_jit_def(fn, self_name=None): | ||
def get_jit_def(fn, self_name=None, def_name_override=None): |
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.
def_name_override should probably not be optional or an override, but actually just the name to use everytime. It seems like otherwise, it will cause bugs when people don't realize the same thing this bug addresses: that this is the name of the field of this method. For instance frontend.py:136 is probably wrong too but wasn't caught in this change.
Before, reassigning a method in a module (like `forward = _forward`) didn't work, because we look at the function object's name for our def name when building AST. Mkae that overrideable to handle cases like reassignment Differential Revision: [D21444535](https://our.internmc.facebook.com/intern/diff/D21444535) [ghstack-poisoned]
Summary: This commit removes a print statement added in pytorch#37994 that appears to be for debugging and was most likely not intended to be commited. Test Plan: Continuous integration.
Summary: **Summary** This commit removes a print statement added in #37994 that appears to be for debugging and was most likely not intended to be commited. **Test Plan** Continuous integration. Pull Request resolved: #38524 Differential Revision: D21587268 Pulled By: SplitInfinity fbshipit-source-id: 6bdcdce647c45f5c0a2ba179a3545a1c0cae1492
Stack from ghstack:
Before, reassigning a method in a module (like
forward = _forward
)didn't work, because we look at the function object's name for our def
name when building AST. Mkae that overrideable to handle cases like
reassignment
Differential Revision: D21444535