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.
1 parent 2dc3f6d commit d4aea9fCopy full SHA for d4aea9f
dpnp/dpnp_utils/dpnp_algo_utils.pyx
@@ -391,7 +391,14 @@ cpdef inline tuple _object_to_tuple(object obj):
391
return ()
392
393
if cpython.PySequence_Check(obj):
394
- return tuple(obj)
+ nd = len(obj)
395
+ shape = []
396
+
397
+ for i in range(0, nd):
398
+ # Assumes each item is castable to Py_ssize_t,
399
+ # otherwise TypeError will be raised
400
+ shape.append(<Py_ssize_t> obj[i])
401
+ return tuple(shape)
402
403
if dpnp.isscalar(obj):
404
return (obj, )
0 commit comments