Skip to content

Commit 2974541

Browse files
committed
BUG: numpy.round(integer array) returns a view in for numpy <=2.4.0.dev0
1 parent b10629e commit 2974541

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

array_api_compat/numpy/_aliases.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,10 @@ def floor(x: Array, /) -> Array:
156156
return np.floor(x)
157157

158158

159+
# https://github.com/numpy/numpy/issues/29124
159160
def round(x: Array, /) -> Array:
160161
if np.issubdtype(x.dtype, np.integer):
161-
return x.copy()
162+
return x
162163
return np.round(x)
163164

164165

0 commit comments

Comments
 (0)