numpy.linalg.matrix_transpose#

linalg.matrix_transpose(x, /)[source]#

Transposes a matrix (or a stack of matrices) x.

This function is Array API compatible.

Parameters:
xarray_like

Input array having shape (…, M, N) and whose two innermost dimensions form MxN matrices.

Returns:
outndarray

An array containing the transpose for each matrix and having shape (…, N, M).

See also

transpose

Generic transpose method.