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 831a5cb commit 402c1d6Copy full SHA for 402c1d6
dpctl/tensor/_usmarray.pyx
@@ -1258,12 +1258,13 @@ cdef usm_ndarray _zero_like(usm_ndarray ary):
1258
Make C-contiguous array of zero elements with same shape
1259
and type as ary.
1260
"""
1261
+ cdef dt = _make_typestr(ary.typenum_)
1262
cdef usm_ndarray r = usm_ndarray(
1263
_make_int_tuple(ary.nd_, ary.shape_),
- dtype=_make_typestr(ary.typenum_),
1264
+ dtype=dt,
1265
buffer=ary.base_.get_usm_type()
1266
)
- # TODO: call function to set array elements to zero
1267
+ r.base_.memset()
1268
return r
1269
1270
0 commit comments