diff options
author | Aaron Meurer <asmeurer@gmail.com> | 2021-02-23 18:14:49 -0700 |
---|---|---|
committer | Aaron Meurer <asmeurer@gmail.com> | 2021-02-23 18:14:49 -0700 |
commit | c791956135e3a1e63ca1e51ec5a1a79e65015ce8 (patch) | |
tree | ea252141a9888fb62137a9c1f6d33cf042140a07 | |
parent | e233a0ac8ac3f740de3537c2cc874446babb21ce (diff) | |
download | numpy-c791956135e3a1e63ca1e51ec5a1a79e65015ce8.tar.gz |
Fix the copy keyword argument in the array_api namespace asarray()
-rw-r--r-- | numpy/_array_api/_creation_functions.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/_array_api/_creation_functions.py b/numpy/_array_api/_creation_functions.py index d015734ff..bd607234d 100644 --- a/numpy/_array_api/_creation_functions.py +++ b/numpy/_array_api/_creation_functions.py @@ -14,7 +14,10 @@ def asarray(obj: Union[float, NestedSequence[bool|int|float], SupportsDLPack, Su if device is not None: # Note: Device support is not yet implemented on ndarray raise NotImplementedError("Device support is not yet implemented") - return np.asarray(obj, dtype=dtype, copy=copy) + if copy is not None: + # Note: copy is not yet implemented in np.asarray + raise NotImplementedError("The copy keyword argument to asarray is not yet implemented") + return np.asarray(obj, dtype=dtype) def arange(start: Union[int, float], /, *, stop: Optional[Union[int, float]] = None, step: Union[int, float] = 1, dtype: Optional[dtype] = None, device: Optional[device] = None) -> array: """ |