dpnp.transpose
- dpnp.transpose(x1, axes=None)[source]
Reverse or permute the axes of an array; returns the modified array.
For full documentation refer to
numpy.transpose.Limitations
Input array is supported as
dpnp.ndarray. Otherwise the function will be executed sequentially on CPU. Value of the parameteraxeslikely to be replaced withNone. Input array data types are limited by supported DPNP Data types.See also
dpnp.moveaxisMove array axes to new positions.
dpnp.argsortReturns the indices that would sort an array.
Examples
>>> import dpnp as np >>> x = np.arange(4).reshape((2,2)) >>> x.shape (2, 2) >>> [i for i in x] [0, 1, 2, 3] >>> out = np.transpose(x) >>> out.shape (2, 2) >>> [i for i in out] [0, 2, 1, 3]