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
asarray
: take the default device into consideration.
#106779
Conversation
Fix: #106773 This PR makes it so `asarray` takes the default device into consideration when called with a Python sequence as the data. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/106779
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ 2 Unrelated FailuresAs of commit 4e4abe5: UNSTABLE - The following jobs failed but were likely due to flakiness present on trunk and has been marked as unstable:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…ation." Fix: #106773 This PR makes it so `asarray` takes the default device into consideration when called with a Python sequence as the data. [ghstack-poisoned]
Fix: #106773 This PR makes it so `asarray` takes the default device into consideration when called with a Python sequence as the data. [ghstack-poisoned]
…ce into consideration." Fix: #106773 This PR makes it so `asarray` takes the default device into consideration when called with a Python sequence as the data. [ghstack-poisoned]
Fix: #106773 This PR makes it so `asarray` takes the default device into consideration when called with a Python sequence as the data. [ghstack-poisoned]
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 for the quick fix @ysiraichi!
test/test_tensor_creation_ops.py
Outdated
3, | ||
np.arange(5), | ||
torch.arange(5), | ||
array.array("f", [1, 2, 3, 4]), |
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.
very minor: "f"
means this constructs a floating-point number. which is tested for exact equality below; using "i"
for integers may be a little more robust (however, tests seem happy, so feel free to ignore this 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.
Ah, you are right. I used "f"
here because I could just call asarray
without any arguments (otherwise I had to pass the dtype). But, I guess that's more robust. Will change.
…nsideration." Fix: #106773 This PR makes it so `asarray` takes the default device into consideration when called with a Python sequence as the data. [ghstack-poisoned]
@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 |
Fix: #106773 This PR makes it so `asarray` takes the default device into consideration when called with a Python sequence as the data. [ghstack-poisoned]
CI failures are not related. |
@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 |
Stack from ghstack (oldest at bottom):
asarray
: take the default device into consideration. #106779Fix: #106773
This PR makes it so
asarray
takes the default device into consideration when called witha Python sequence as the data.