diff options
| author | Aaron Meurer <asmeurer@gmail.com> | 2021-01-12 16:21:46 -0700 |
|---|---|---|
| committer | Aaron Meurer <asmeurer@gmail.com> | 2021-01-12 16:21:46 -0700 |
| commit | 4bd5d158e66e6b1ca5f1a767738f0674f0dc8095 (patch) | |
| tree | d4f20ac37d2ae241e14589150d4fe75620a141e7 /numpy/_array_api/_manipulation_functions.py | |
| parent | ba4e21ca150a2d8b3cc08a3e8c981f7042aacf6f (diff) | |
| download | numpy-4bd5d158e66e6b1ca5f1a767738f0674f0dc8095.tar.gz | |
Use "import numpy as np" in the array_api submodule
This avoids importing everything inside the individual functions, but still is
preferred over importing the functions used explicitly, as most of them clash
with the wrapper function names.
Diffstat (limited to 'numpy/_array_api/_manipulation_functions.py')
| -rw-r--r-- | numpy/_array_api/_manipulation_functions.py | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/numpy/_array_api/_manipulation_functions.py b/numpy/_array_api/_manipulation_functions.py index 19e9c1cab..262c712f8 100644 --- a/numpy/_array_api/_manipulation_functions.py +++ b/numpy/_array_api/_manipulation_functions.py @@ -1,28 +1,23 @@ +import numpy as np + def concat(arrays, /, *, axis=0): # Note: the function name is different here - from .. import concatenate - return concatenate(arrays, axis=axis) + return np.concatenate(arrays, axis=axis) def expand_dims(x, axis, /): - from .. import expand_dims - return expand_dims(x, axis) + return np.expand_dims(x, axis) def flip(x, /, *, axis=None): - from .. import flip - return flip(x, axis=axis) + return np.flip(x, axis=axis) def reshape(x, shape, /): - from .. import reshape - return reshape(x, shape) + return np.reshape(x, shape) def roll(x, shift, /, *, axis=None): - from .. import roll - return roll(x, shift, axis=axis) + return np.roll(x, shift, axis=axis) def squeeze(x, /, *, axis=None): - from .. import squeeze - return squeeze(x, axis=axis) + return np.squeeze(x, axis=axis) def stack(arrays, /, *, axis=0): - from .. import stack - return stack(arrays, axis=axis) + return np.stack(arrays, axis=axis) |
