diff options
author | Gagandeep Singh <gdp.1807@gmail.com> | 2021-11-02 11:28:17 +0530 |
---|---|---|
committer | Gagandeep Singh <gdp.1807@gmail.com> | 2021-11-02 11:28:17 +0530 |
commit | c04509e86e97a69a0b5fcbeebdbec66faad3dbe0 (patch) | |
tree | b5940db3ad46e55b88d566ec058007dc3c6b7e72 /numpy/array_api/_manipulation_functions.py | |
parent | 56647dd47345a7fd24b4ee8d9d52025fcdc3b9ae (diff) | |
parent | fae6fa47a3cf9b9c64af2f5bd11a3b644b1763d2 (diff) | |
download | numpy-c04509e86e97a69a0b5fcbeebdbec66faad3dbe0.tar.gz |
resolved conflicts
Diffstat (limited to 'numpy/array_api/_manipulation_functions.py')
-rw-r--r-- | numpy/array_api/_manipulation_functions.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/array_api/_manipulation_functions.py b/numpy/array_api/_manipulation_functions.py index c11866261..4f2114ff5 100644 --- a/numpy/array_api/_manipulation_functions.py +++ b/numpy/array_api/_manipulation_functions.py @@ -41,6 +41,17 @@ def flip(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None) -> return Array._new(np.flip(x._array, axis=axis)) +# Note: The function name is different here (see also matrix_transpose). +# Unlike transpose(), the axes argument is required. +def permute_dims(x: Array, /, axes: Tuple[int, ...]) -> Array: + """ + Array API compatible wrapper for :py:func:`np.transpose <numpy.transpose>`. + + See its docstring for more information. + """ + return Array._new(np.transpose(x._array, axes)) + + def reshape(x: Array, /, shape: Tuple[int, ...]) -> Array: """ Array API compatible wrapper for :py:func:`np.reshape <numpy.reshape>`. |