Skip to content

Commit 2ff0634

Browse files
committed
Remove numpy 2.0 version check from the numpy asarray helper
NumPy 2.0 no longer uses the wrapper code at all (unless explicitly requested with array_namespace(use_compat=True), but this is not really supported).
1 parent a7da560 commit 2ff0634

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

array_api_compat/numpy/_aliases.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,6 @@ def asarray(
9494
See the corresponding documentation in the array library and/or the array API
9595
specification for more details.
9696
"""
97-
if np.__version__[0] >= '2':
98-
# NumPy 2.0 asarray() is completely array API compatible. No need for
99-
# the complicated logic below
100-
return np.asarray(obj, dtype=dtype, device=device, copy=copy, **kwargs)
101-
10297
if device not in ["cpu", None]:
10398
raise ValueError(f"Unsupported device for NumPy: {device!r}")
10499

0 commit comments

Comments
 (0)