-
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
Permit "same_kind"
casting for usm_ndarray
element-wise in-place operators
#1827
Conversation
f81119f
to
13fde04
Compare
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_9 ran successfully. |
2 similar comments
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_9 ran successfully. |
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_9 ran successfully. |
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_10 ran successfully. |
This method permits casting behavior equivalent to `"same_kind"` when using in-place operators by introducing the `_inplace_op` method Expands this to `__imatmul__` as well through use of the already-implemented `dtype` keyword
…ame_kind"` casting
f1ac695
to
79208c8
Compare
Raises `ValueError` otherwise
…re both inputs are broadcast to a new shape
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_13 ran successfully. |
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_14 ran successfully. |
Also clean up and make some tests for in-place operators more efficient
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_16 ran successfully. |
@oleksandr-pavlyk |
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_17 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.
Overall this change looks good to me, modulo a nit! Thank you @ndgrigorian
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_18 ran successfully. |
I ran |
…ace_dtype_matrix`
Co-authored-by: Oleksandr Pavlyk <[email protected]>
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_19 ran successfully. |
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_20 ran successfully. |
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_21 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! Thank you @ndgrigorian
The PR proposes to permit `"same_kind"` casting for element-wise in-place operators. The implementation leverages on dpctl changes added in scope of [PR#1827](IntelPython/dpctl#1827). It also adds callbacks to support in-place bit-wise operators (leverages on dpctl changes from [RR#1447](IntelPython/dpctl#1447)). The PR removes a temporary workaround from `dpnp.wrap` which depends on the implemented changes.
The PR proposes to permit `"same_kind"` casting for element-wise in-place operators. The implementation leverages on dpctl changes added in scope of [PR#1827](IntelPython/dpctl#1827). It also adds callbacks to support in-place bit-wise operators (leverages on dpctl changes from [RR#1447](IntelPython/dpctl#1447)). The PR removes a temporary workaround from `dpnp.wrap` which depends on the implemented changes. 3d02b6b
This pull request proposes a new implementation for in-place element-wise operators which permits casting equivalent to
"same_kind"
This allows such operations as
This PR maintains the inclusion of (conditionally used) in-place kernels in element-wise operators when
dpt.bin_op(x, y, out=x)
for somebin_op
which has an in-place implementation.Resolves #1757