Skip to content

Commit 170acc7

Browse files
committed
.
1 parent 54a148b commit 170acc7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

array_api_compat/numpy/_aliases.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,23 @@ def take_along_axis(x: Array, indices: Array, /, *, axis: int = -1):
146146

147147
def ceil(x: Array, /) -> Array:
148148
if np.issubdtype(x.dtype, np.integer):
149-
return x.copy()
149+
if np.__version__ < '2':
150+
return x
150151
return np.ceil(x)
151152

152153

153154
def floor(x: Array, /) -> Array:
154155
if np.issubdtype(x.dtype, np.integer):
155-
return x.copy()
156+
if np.__version__ < '2':
157+
return x
156158
return np.floor(x)
157159

158160

159161
# https://github.com/numpy/numpy/issues/29124
160162
def round(x: Array, /) -> Array:
161163
if np.issubdtype(x.dtype, np.integer):
162164
if np.__version__ < '2':
163-
return x.copy()
165+
return x
164166
return np.round(x)
165167

166168

0 commit comments

Comments
 (0)