mlx.core.transpose#

mlx.core.transpose(a: array, /, axes: Optional[List[int]] = None, *, stream: Union[None, Stream, Device] = None) array#

Transpose the dimensions of the array.

Parameters:
  • a (array) – Input array.

  • axes (list(int), optional) – Specifies the source axis for each axis in the new array. The default is to reverse the axes.

Returns:

The transposed array.

Return type:

array