Skip to content
fn

swapaxes_op

→TensorImplPtr
int swapaxes_op(const int & a, int axis1, int axis2)

Python wrappers

Public Python APIs implemented by this engine symbol.

Swap two named axes of a, wrapping negative indices.

Parameters

aTensorImplPtr
Input tensor.
axis1, axis2int
Axes to swap. Negative values count from the end.

Returns

TensorImplPtr

View of a with the two requested axes swapped and all other axes left in place.

Raises

IndexError
If either axis falls outside [-ndim, ndim) after normalisation.