Skip to content

reshape throws error "invalid entry in coordinates array" #591

Closed
@Alexander-Makaryev

Description

@Alexander-Makaryev
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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions