summaryrefslogtreecommitdiff
path: root/numpy/_array_api/_creation_functions.py
diff options
context:
space:
mode:
authorAaron Meurer <asmeurer@gmail.com>2021-03-02 16:29:07 -0700
committerAaron Meurer <asmeurer@gmail.com>2021-03-02 16:29:07 -0700
commit7132764661b01e2f15a66d7c39d74ad4b2d434a9 (patch)
tree90a3dcbb52452f84ca67de8a7c1eb9eb44e8b6d9 /numpy/_array_api/_creation_functions.py
parent63be085194ddf9d2d8fc32a0ccbe30936c78d870 (diff)
downloadnumpy-7132764661b01e2f15a66d7c39d74ad4b2d434a9.tar.gz
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.
Diffstat (limited to 'numpy/_array_api/_creation_functions.py')
-rw-r--r--numpy/_array_api/_creation_functions.py8
1 files changed, 4 insertions, 4 deletions
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))