Permit "same_kind" casting for usm_ndarray element-wise in-place operators#1827
Permit "same_kind" casting for usm_ndarray element-wise in-place operators#1827ndgrigorian merged 10 commits intomasterfrom
"same_kind" casting for usm_ndarray element-wise in-place operators#1827Conversation
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. |
oleksandr-pavlyk
left a comment
There was a problem hiding this comment.
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 <oleksandr.pavlyk@intel.com>
|
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. |
oleksandr-pavlyk
left a comment
There was a problem hiding this comment.
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_opwhich has an in-place implementation.Resolves #1757