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. Parameter axis1 is limited by axis1 < x1.ndim. Parameter axis2 is limited by axis2 < 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]