Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Bug fix / Enhancement array initialization different devices #678
Bug fix / Enhancement array initialization different devices #678
Changes from 22 commits
9566f45
7968876
e4e2d2a
82b523f
b93bccb
7b8fb1a
133def1
cd606d8
b0dc5d6
159b2b5
7eff3a5
0e60691
33551b8
6637fa2
b835d1e
7ce55e7
bd5903c
c3ab419
a52c92b
62e1e6b
c8b4d1e
889f2be
c1705bc
09290f9
ca5f688
6046ab7
27d7134
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Should I keep the assertion or the warning here?
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.
I deleted the assertion as there are some rare cases where it is allowed. However the unittest results must be reviewed for possible wrong devices.
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.
why is the implicit data transfer ok here? 🤔
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.
It's analogous to dtype in factories.array(). The user explicitly wants to use a specific device here.
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.
On internal functions, however, it still can obfuscate some wrong devices if the device parameter is overused. I add a warning.
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.
OK, yes I can see why we want to transfer data here. On internal functions, we have to keep an eye on it during review and testing I guess.