transpose

abstract fun Tensor<T>.transpose(i: Int = -2, j: Int = -1): Tensor<T>

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

Return

transposed tensor

Parameters

i

the first dimension to be transposed

j

the second dimension to be transposed

Sources

common source
Link copied to clipboard