Skip to content
fn

mT_op

→TensorImplPtr
int mT_op(const int & a)

Batch matrix-transpose — swap the last two axes only, leaving all leading batch axes intact. Backing function for the .mT tensor property and standard for batched matmul transposes.

Parameters

aTensorImplPtr
Input tensor; must have ndim >= 2.

Returns

TensorImplPtr

View of a with the final two axes swapped.

Raises

ValueError
If a.ndim < 2.