Skip to content

Commit 54a148b

Browse files
committed
.
1 parent 2974541 commit 54a148b

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
@@ -159,7 +159,8 @@ def floor(x: Array, /) -> Array:
159159
# https://github.com/numpy/numpy/issues/29124
160160
def round(x: Array, /) -> Array:
161161
if np.issubdtype(x.dtype, np.integer):
162-
return x
162+
if np.__version__ < '2':
163+
return x.copy()
163164
return np.round(x)
164165

165166

0 commit comments

Comments
 (0)