-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Add type annotations to torch.overrides #48493
Conversation
💊 CI failures summary and remediationsAs of commit 3a123bc (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This 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 to the (internal) Dr. CI Users group. |
Codecov Report
@@ Coverage Diff @@
## master #48493 +/- ##
==========================================
+ Coverage 80.66% 80.71% +0.04%
==========================================
Files 1913 1904 -9
Lines 208058 206632 -1426
==========================================
- Hits 167833 166775 -1058
+ Misses 40225 39857 -368 |
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 @guilhermeleobas. It would be good to not add too many unnecessary ignores, but just fix the missing annotations.
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.
LGTM, thanks @guilhermeleobas!
torch/overrides.py
Outdated
Tensor._grad.__get__: lambda self: -1, | ||
Tensor._grad_fn.__get__: lambda self: -1, | ||
Tensor.grad_fn.__get__: lambda self: -1, | ||
Tensor._version.__get__: lambda self: -1, | ||
Tensor._version.__get__: lambda self: -1, # type: ignore[attr-defined] |
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.
If mypy doesn't recognize this, we should file a missing annotation report.
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.
Actually, Tensor._version
is already annotated and this type: ignore
can be safely removed.
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.
Oh, in that case I'd expect all the X.__get__
ignores can be removed. Please do so.
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.
Done!
In general, this LGTM, but I'd double-check if the ignores in the diff are necessary. |
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.
Looks like there are still some failures. Happy to merge once they're resolved. |
I don't know why but the facebook bot just closed this PR. |
It got merged, you should make a follow-up PR. |
This seems to have broken the
|
Hey @guilhermeleobas, this breaks several tests on master, which hides real test signals. Landing a new PR would take a few hours. To avoid blocking other developers, I am going to revert this one. Please reland with your fix. Thanks! |
This pull request has been reverted by 1f5c3b3. |
Fixes #48492