Contents

transposed()

Permutes the tensor with dimensions permuted in reverse order.

Declaration

func transposed() -> MLTensor

Return Value

A permuted tensor.

Discussion

For example:

let x = MLTensor(shape: [1, 2, 3], scalars: [1, 2, 3, 4, 5, 6], scalarType: Float.self)
let y = x.transposed()
y.shape // is [3, 2, 1]

See Also

Transposing the tensor