From 7132764661b01e2f15a66d7c39d74ad4b2d434a9 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Tue, 2 Mar 2021 16:29:07 -0700 Subject: Remove _implementation from the array API functions As discussed at https://mail.python.org/pipermail/numpy-discussion/2021-February/081541.html, _implementation is not as useful for the array API module as previously thought. --- numpy/_array_api/_creation_functions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'numpy/_array_api/_creation_functions.py') diff --git a/numpy/_array_api/_creation_functions.py b/numpy/_array_api/_creation_functions.py index 888f24558..5b73c8f5c 100644 --- a/numpy/_array_api/_creation_functions.py +++ b/numpy/_array_api/_creation_functions.py @@ -62,7 +62,7 @@ def empty_like(x: array, /, *, dtype: Optional[dtype] = None, device: Optional[d if device is not None: # Note: Device support is not yet implemented on ndarray raise NotImplementedError("Device support is not yet implemented") - return ndarray._new(np.empty_like._implementation(x._array, dtype=dtype)) + return ndarray._new(np.empty_like(x._array, dtype=dtype)) def eye(N: int, /, *, M: Optional[int] = None, k: Optional[int] = 0, dtype: Optional[dtype] = None, device: Optional[device] = None) -> array: """ @@ -109,7 +109,7 @@ def full_like(x: array, fill_value: Union[int, float], /, *, dtype: Optional[dty if device is not None: # Note: Device support is not yet implemented on ndarray raise NotImplementedError("Device support is not yet implemented") - res = np.full_like._implementation(x._array, fill_value, dtype=dtype) + res = np.full_like(x._array, fill_value, dtype=dtype) if res.dtype not in _all_dtypes: # This will happen if the fill value is not something that NumPy # coerces to one of the acceptable dtypes. @@ -150,7 +150,7 @@ def ones_like(x: array, /, *, dtype: Optional[dtype] = None, device: Optional[de if device is not None: # Note: Device support is not yet implemented on ndarray raise NotImplementedError("Device support is not yet implemented") - return ndarray._new(np.ones_like._implementation(x._array, dtype=dtype)) + return ndarray._new(np.ones_like(x._array, dtype=dtype)) def zeros(shape: Union[int, Tuple[int, ...]], /, *, dtype: Optional[dtype] = None, device: Optional[device] = None) -> array: """ @@ -174,4 +174,4 @@ def zeros_like(x: array, /, *, dtype: Optional[dtype] = None, device: Optional[d if device is not None: # Note: Device support is not yet implemented on ndarray raise NotImplementedError("Device support is not yet implemented") - return ndarray._new(np.zeros_like._implementation(x._array, dtype=dtype)) + return ndarray._new(np.zeros_like(x._array, dtype=dtype)) -- cgit v1.2.1