dpnp.swapaxes
- dpnp.swapaxes(x1, axis1, axis2)[source]
Interchange two axes of an array.
For full documentation refer to
numpy.swapaxes
.Limitations
Input array is supported as
dpnp.ndarray
. Otherwise the function will be executed sequentially on CPU. Parameteraxis1
is limited byaxis1 < x1.ndim
. Parameteraxis2
is limited byaxis2 < x1.ndim
. Input array data types are limited by supported DPNP Data types.Examples
>>> import dpnp as np >>> x = np.array([[1, 2, 3]]) >>> out = np.swapaxes(x, 0, 1) >>> out.shape (3, 1) >>> [i for i in out] [1, 2, 3]