Closed
Description
The below example reproduces an issue with passing integer scalar to the shape setter:
import numpy, dpctl, dpctl.tensor as dpt
dpctl.__version__
# Out: '0.18.0dev0+158.g7450558d25'
a = dpt.usm_ndarray((2, 3))
a.shape = 6
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[3], line 1
----> 1 a.shape = 6
File dpctl/tensor/_usmarray.pyx:579, in dpctl.tensor._usmarray.usm_ndarray.shape.__set__()
TypeError: object of type 'int' has no len()
# but works in numpy
a = numpy.ndarray((2, 3))
a.shape = 6
Metadata
Metadata
Assignees
Labels
No labels