We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
usm_ndarray(10, 'd')
1 parent 0ee8e5f commit 4530026Copy full SHA for 4530026
dpctl/tensor/_usmarray.pyx
@@ -130,12 +130,17 @@ cdef class usm_ndarray:
130
cdef Py_ssize_t _offset = offset
131
cdef Py_ssize_t ary_min_displacement = 0
132
cdef Py_ssize_t ary_max_displacement = 0
133
+ cdef Py_ssize_t tmp = 0
134
cdef char * data_ptr = NULL
135
136
self._reset()
137
if (not isinstance(shape, (list, tuple))
138
and not hasattr(shape, 'tolist')):
- raise TypeError("Argument shape must be a list of a tuple.")
139
+ try:
140
+ tmp = <Py_ssize_t> shape
141
+ shape = [shape, ]
142
+ except Exception:
143
+ raise TypeError("Argument shape must be a list or a tuple.")
144
nd = len(shape)
145
typenum = dtype_to_typenum(dtype)
146
itemsize = type_bytesize(typenum)
0 commit comments