transposed

abstract fun StructureND<T>.transposed(i: Int = shape.size - 2, j: Int = shape.size - 1): Tensor<T>(source)

Returns a tensor that is a transposed version of this tensor. The given dimensions i and j are swapped. For more information: https://pytorch.org/docs/stable/generated/torch.transpose.html

If axis indices are negative, they are counted from shape end.

Return

transposed tensor

Parameters

i

the first dimension to be transposed

j

the second dimension to be transposed