transposed()
Permutes the tensor with dimensions permuted in reverse order.
Declaration
func transposed() -> MLTensorReturn 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]