Skip to content
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

Closed
wants to merge 7 commits into from

Conversation

ysiraichi
Copy link
Collaborator

@ysiraichi ysiraichi commented Aug 8, 2023

Stack from ghstack (oldest at bottom):

Fix: #106773

This PR makes it so asarray takes the default device into consideration when called with
a Python sequence as the data.

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]
@pytorch-bot
Copy link

pytorch-bot bot commented Aug 8, 2023

🔗 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 SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ 2 Unrelated Failures

As 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.

ysiraichi added a commit that referenced this pull request 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-source-id: 92adeacccc0cfadb8268996a2e8a784c254debed
Pull Request resolved: #106779
…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 pull request 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-source-id: 12fa2061ec04816b0c0d9a473265651f226ef513
Pull Request resolved: #106779
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 pull request 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-source-id: 50f80e40e925bea99b38448622cf2f4ca9291983
Pull Request resolved: #106779
…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 pull request 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-source-id: 5da66d04339a5c3e13ca9d833f06821bf74bf019
Pull Request resolved: #106779
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 pull request 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-source-id: 20b11f284198b1ba80facaa977c4e2cd13a0c606
Pull Request resolved: #106779
Copy link
Collaborator

@rgommers rgommers left a 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!

3,
np.arange(5),
torch.arange(5),
array.array("f", [1, 2, 3, 4]),
Copy link
Collaborator

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)

Copy link
Collaborator Author

@ysiraichi ysiraichi Aug 9, 2023

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]
ysiraichi added a commit that referenced this pull request 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-source-id: 0552a22c3828d69fcc3ce93c5fe44d6326f7de50
Pull Request resolved: #106779
@ysiraichi
Copy link
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 9, 2023
@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: This PR needs a release notes: label
If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Details for Dev Infra team Raised by workflow job

@ysiraichi ysiraichi added the release notes: python_frontend release notes category label 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]
ysiraichi added a commit that referenced this pull request 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-source-id: b4083530905e659983db72dab81eadbc8172ead9
Pull Request resolved: #106779
@ysiraichi
Copy link
Collaborator Author

CI failures are not related.

@ysiraichi
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@facebook-github-bot facebook-github-bot deleted the gh/ysiraichi/77/head branch August 14, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged open source release notes: python_frontend release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants