mx.symbol.SwapAxis

Description

Interchanges two axes of an array.

Example:

x = [[1, 2, 3]])
swapaxes(x, 0, 1) = [[ 1],
[ 2],
[ 3]]

x = [[[ 0, 1],
[ 2, 3]],
[[ 4, 5],
[ 6, 7]]]  // (2,2,2) array

swapaxes(x, 0, 2) = [[[ 0, 4],
[ 2, 6]],
[[ 1, 5],
[ 3, 7]]]

Usage

mx.symbol.SwapAxis(...)

Arguments

Argument

Description

data

NDArray-or-Symbol.

Input array.

dim1

int, optional, default=’0’.

the first axis to be swapped.

dim2

int, optional, default=’0’.

the second axis to be swapped.

name

string, optional.

Name of the resulting symbol.