Conversation
Closes gh-1664 If copy is not required, and requested shape is the same as the shape of the array, return the array itself.
|
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_355 ran successfully. |
|
53 tests affecting call of The first issue I've found is incorrect result returned below: import dpnp
from dpnp.dpnp_utils.dpnp_utils_linearalgebra import _define_contig_flag
a = dpnp.arange(3).reshape((1, 3, 1))
_define_contig_flag(a)
# Out: Falsebut it's expected to return The second one is somewhere in import dpctl, dpctl.tensor as dpt
import dpnp.backend.extensions.blas._blas_impl as bi
a = dpt.reshape(dpt.arange(60, dtype='f4'), (5, 4, 3))
b = dpt.reshape(dpt.arange(3, dtype='f4'), (1, 3, 1))
b = dpt.copy(b)
c = dpt.zeros((5, 4, 1))
a.strides, b.strides, c.strides
# Out: ((12, 3, 1), (3, 1, 1), (4, 1, 1))
ev, _, _ = bi._gemm_batch(a.sycl_queue, a, b, c)
ev.wait()
c
# Out:
# usm_ndarray([[[ 5.],
# [14.],
# [23.],
# [32.]],
#
# [[ 0.],
# [ 0.],
# [ 0.],
# [ 0.]],
#
# [[ 0.],
# [ 0.],
# [ 0.],
# [ 0.]],
#
# [[ 0.],
# [ 0.],
# [ 0.],
# [ 0.]],
#
# [[ 0.],
# [ 0.],
# [ 0.],
# [ 0.]]], dtype=float32)@vtavana , could you please look on that? |
The necessary changes are implemented in dpnp-gh-1828. Relevant tests in |
First case is working correctly in dpctl @vtavana does dpnp-gh-1828 address this case too? |
Yes, both examples provided by @antonwolfy also work fine in dpnp-gh-1828. As a side note, |
ndgrigorian
left a comment
There was a problem hiding this comment.
Tested this out, this LGTM!
Closes gh-1664.
Improves performance of
dpt.reshape(X, new_shape, order="F")when copy is needed.