-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Let tensor_a.new_tensor()
be on tensor_a.device
by default
#144958
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/144958
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 8868a78 with merge base d2a77f4 ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot label "topic: bc breaking" |
00bcb32
to
101652b
Compare
ba615d3
to
bfdaeab
Compare
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.
Nice catch
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…ch#144958) Fixes pytorch#144957 Closes pytorch#73838 cc @albanD @ezyang Currently, `tensor_a.new_tensor()` will return a on-cpu tensor no matter where is `tensor_a`. This differs from the document and is a side-effect of pytorch#41984. See pytorch#144957 how current logic breaks dynamo. This PR restore the documented behavior and add tests for `new_tensor`. Pull Request resolved: pytorch#144958 Approved by: https://github.com/ezyang
Fixes #144957
Closes #73838 cc @albanD @ezyang
Currently,
tensor_a.new_tensor()
will return a on-cpu tensor no matter where istensor_a
. This differs from the document and is a side-effect of #41984.See #144957 how current logic breaks dynamo.
This PR restore the documented behavior and add tests for
new_tensor
.