Skip to content

Commit 39f057a

Browse files
committed
Allow type casting of zero-sized array to any dtype
1 parent e2789db commit 39f057a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dpctl/tensor/_usmarray.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ cdef class usm_ndarray:
382382
else:
383383
self._cleanup()
384384
raise ValueError("buffer='{}' was not understood.".format(buffer))
385-
if (_offset + ary_min_displacement < 0 or
385+
if shape_to_elem_count(nd, shape_ptr) > 0 and (_offset + ary_min_displacement < 0 or
386386
(_offset + ary_max_displacement + 1) * itemsize > _buffer.nbytes):
387387
self._cleanup()
388388
raise ValueError(("buffer='{}' can not accommodate "

0 commit comments

Comments
 (0)