-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Replace torch.is_tensor usages with isinstance checks. #38062
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
`is_tensor` doesn't really have a reason to exist anymore (other than backwards compatibility) and is worse for typechecking with mypy (see pytorchgh-32824). Given that it may not be obvious what the fix is once mypy gives an error, make the change in a number of places at once, and add a note on this to the `is_tensor` docstring. Recommending an isinstance check instead has been done for quite a while, e.g. pytorch#7769 (comment)
💊 CI failures summary and remediationsAs of commit b6a1afc (more details on the Dr. CI page):
🕵️ 3 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
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 is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
is_tensordoesn't really have a reason to exist anymore (other thanbackwards compatibility) and is worse for typechecking with mypy (see
gh-32824). Given that it may not be obvious what the fix is once mypy
gives an error, make the change in a number of places at once, and add
a note on this to the
is_tensordocstring.Recommending an isinstance check instead has been done for quite a
while, e.g. #7769 (comment)