-
Notifications
You must be signed in to change notification settings - Fork 30
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
Type promotion for indices
arrays and casting vals
in integer indexing
#1647
Conversation
Setting items in an array now casts the right-hand side to the array data type when the data types differ Setting and getting from an empty axis with non-empty indices now throws `IndexError`
Fixes `take` and `put` being used on non-empty axes with non-empty indices Also adds a note to `put` about race conditions for non-unique indices
Also corrects error raised in _put_multi_index when attempting to put into indices along an empty axis
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_305 ran successfully. |
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.
Needed change overall! Two small nits :)
Thanks for working on this @ndgrigorian !
Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_306 ran successfully. |
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!
This pull request proposes resolutions to #1360, #1382, and #1482 by changing the behavior of advanced indexing and indexing functions.
x[i_0, i_1, ...]
now promotes arraysi_0 ... i_N
to an appropriate integer data type, and only raises where such a data type cannot be foundx[indices] = vals
now castsvals
to the data type ofx
regardless of type. This aligns withplace
/boolean indexing.dpt.put
now warns the user about race conditions when indices are not uniqueAdditionally, this PR implements changes to
take
,put
, and generalized advanced integer indexing which handle cases where empty axes are being indexed.