<!--
{
  "availability" : [
    "iOS: 14.0.0 - 17.0.0",
    "iPadOS: 14.0.0 - 17.0.0",
    "macCatalyst: 14.0.0 - 17.0.0",
    "macOS: 11.0.0 - 14.0.0",
    "tvOS: 14.0.0 - 17.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "MLCompute",
  "identifier" : "/documentation/MLCompute/MLCTransposeLayer/init(dimensions:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "ML Compute",
      "MLCompute"
    ],
    "preciseIdentifier" : "s:So17MLCTransposeLayerC9MLComputeE10dimensionsABSgSaySiG_tcfc"
  },
  "title" : "init(dimensions:)"
}
-->

# init(dimensions:)

Creates a transpose layer with the dimensions you specify.

```
convenience init?(dimensions: [Int])
```

## Parameters

`dimensions`

An array that represents the ordering of dimensions.

## Discussion

The `dimensions` array contains an input axis source for each output axis. In other words, the `n`th element in the dimensions array specifies the input axis source for the `n`th axis in the output. You can’t transpose the batch dimension, which is typically axis 0.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)