Skip to content

Commit 402c1d6

Browse files
Fixed TODO in utility _zero_like
1 parent 831a5cb commit 402c1d6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dpctl/tensor/_usmarray.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,12 +1258,13 @@ cdef usm_ndarray _zero_like(usm_ndarray ary):
12581258
Make C-contiguous array of zero elements with same shape
12591259
and type as ary.
12601260
"""
1261+
cdef dt = _make_typestr(ary.typenum_)
12611262
cdef usm_ndarray r = usm_ndarray(
12621263
_make_int_tuple(ary.nd_, ary.shape_),
1263-
dtype=_make_typestr(ary.typenum_),
1264+
dtype=dt,
12641265
buffer=ary.base_.get_usm_type()
12651266
)
1266-
# TODO: call function to set array elements to zero
1267+
r.base_.memset()
12671268
return r
12681269

12691270

0 commit comments

Comments
 (0)