-
Notifications
You must be signed in to change notification settings - Fork 24.4k
torch.asarray
does not respect set_default_device
#106773
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
Labels
bug
module: numpy
Related to numpy support, and also numpy compatibility of our operators
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Comments
ysiraichi
added a commit
that referenced
this issue
Aug 8, 2023
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]
ysiraichi
added a commit
that referenced
this issue
Aug 8, 2023
…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]
ysiraichi
added a commit
that referenced
this issue
Aug 8, 2023
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]
ysiraichi
added a commit
that referenced
this issue
Aug 8, 2023
…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]
ysiraichi
added a commit
that referenced
this issue
Aug 8, 2023
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]
ysiraichi
added a commit
that referenced
this issue
Aug 9, 2023
…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]
ysiraichi
added a commit
that referenced
this issue
Aug 9, 2023
…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]
ysiraichi
added a commit
that referenced
this issue
Aug 9, 2023
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]
This was referenced Sep 5, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
module: numpy
Related to numpy support, and also numpy compatibility of our operators
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Uh oh!
There was an error while loading. Please reload this page.
🐛 Describe the bug
torch.asarray
should be respectingset_default_device
like all other tensor creation functions, but it doesn't. We ran into this in the process of testing SciPy's in-progress support for PyTorch tensors (see this comment):The
asarray
function is quite important, because it allows writing library-agnostic code andasarray
is one of the most heavily used functions in test suites when doing so.Versions
This is with pytorch 2.0.0. Full environment details:
Cc @ysiraichi as the original author (I believe) of
torch.asarray
.The text was updated successfully, but these errors were encountered: