You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the data type (either specified or resolved) differs from the data type of x, the input array should be cast to the specified data type before computing the sum ...
With this in mind, dpctl does not behave correct
importdpctl.tensorasdpta=dpt.asarray([-1, 1], dtype=dpt.int32)
dpt.sum(a)
# usm_ndarray(0)dpt.sum(a, dtype=dpt.bool)
# usm_ndarray(False)# However what array API is specifying is dpt.sum(dpt.astype(a, dpt.bool), dtype=dpt.bool)
# usm_ndarray(True)# NumPy follows Array APIimportnumpynumpy.__version__# '2.2.0'b=numpy.zeros(2, dtype=numpy.int32)
b.sum()
# np.int64(0)b.sum(dtype=numpy.bool_)
# np.False_
The text was updated successfully, but these errors were encountered:
Python Array API for
sum
function states:With this in mind,
dpctl
does not behave correctThe text was updated successfully, but these errors were encountered: