Skip to content

Commit 434015f

Browse files
committed
Small bugfix in _zero_like
_zero_like did not have logic accounting for 0D arrays, so `x.imag` failed for 0D x
1 parent 3f24ef2 commit 434015f

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
@@ -1311,7 +1311,7 @@ cdef usm_ndarray _zero_like(usm_ndarray ary):
13111311
"""
13121312
cdef dt = _make_typestr(ary.typenum_)
13131313
cdef usm_ndarray r = usm_ndarray(
1314-
_make_int_tuple(ary.nd_, ary.shape_),
1314+
_make_int_tuple(ary.nd_, ary.shape_) if ary.nd_ > 0 else tuple(),
13151315
dtype=dt,
13161316
buffer=ary.base_.get_usm_type()
13171317
)

0 commit comments

Comments
 (0)