-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Issue 43057 #43063
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
Issue 43057 #43063
Conversation
A small change that adds a docstring that can be found with `getattr(nn.Module, nn.Module.forward.__name__, None).__doc__` Closes pytorch#43057
torch/nn/modules/module.py
Outdated
| # forward as a value, rather than a function. See also | ||
| # https://github.com/python/mypy/issues/8795 | ||
| def _forward_unimplemented(self, *input: Any) -> None: | ||
| r"""Forward defines the computation performed at every call. |
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.
Instead of making this a docstring, I would have expected the string next to forward to be set as the docstring on the forward object and for this to be unchanged. Don't you want the other string as the docstring?
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 for the advice. I wasn't sure how best to do this as I was reluctant to move the docstring for forward away from the definition of forward.
I've made that change.
mruberry
left a comment
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 @olliethomas!
|
@ezyang Looks like you last moved this doc string, want to sanity check this change? |
facebook-github-bot
left a comment
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.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
A small change that adds a docstring that can be found with
getattr(nn.Module, nn.Module.forward.__name__, None).__doc__Fixes #43057