---
title: transposed()
framework: coreml
role: symbol
role_heading: Instance Method
path: coreml/mltensor/transposed()
---

# transposed()

Permutes the tensor with dimensions permuted in reverse order.

## Declaration

```swift
func transposed() -> MLTensor
```

## Return Value

Return Value A permuted tensor.

## Discussion

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

- [transposed(permutation:)](coreml/mltensor/transposed(permutation:).md)
