You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
reshape throws error "invalid entry in coordinates array" #591
In [1]: import dpctl.tensor as dpt
In [2]: a = dpt.usm_ndarray((2,), dtype='d')
In [3]: b = dpt.reshape(a, (2, 1))
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-3-43177a145b73> in <module>
----> 1 b = dpt.reshape(a, (2, 1))
/localdisk/work/amakarye/miniconda3/envs/dpnptc4_internal/lib/python3.8/site-packages/dpctl/tensor/_reshape.py in reshape(X, newshape, order)
54 if not isinstance(newshape, collections.abc.Sized):
55 newshape = (newshape,)
---> 56 newsts = reshaped_strides(X.shape, X.strides, newshape, order=order)
57 if newsts is None:
58 # must perform a copy
/localdisk/work/amakarye/miniconda3/envs/dpnptc4_internal/lib/python3.8/site-packages/dpctl/tensor/_reshape.py in reshaped_strides(old_sh, old_sts, new_sh, order)
23 )
24 )
---> 25 for flat_index in [
26 np.ravel_multi_index(unitvec, new_sh, order=order)
27 for unitvec in eye_new_mi
/localdisk/work/amakarye/miniconda3/envs/dpnptc4_internal/lib/python3.8/site-packages/dpctl/tensor/_reshape.py in <listcomp>(.0)
24 )
25 for flat_index in [
---> 26 np.ravel_multi_index(unitvec, new_sh, order=order)
27 for unitvec in eye_new_mi
28 ]
<__array_function__ internals> in ravel_multi_index(*args, **kwargs)
ValueError: invalid entry in coordinates array
Activity
Closes #591
Implemented special methods for usm_ndarray per data-API
Implemented special methods for usm_ndarray per data-API