---
title: "init(dimensions:)"
framework: ML Compute
role: symbol
role_heading: Initializer
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+]
path: "mlcompute/mlctransposelayer/init(dimensions:)"
---

# init(dimensions:)

Creates a transpose layer with the dimensions you specify.

## Declaration

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

## Parameters

- `dimensions`: An array that represents the ordering of dimensions.

## Discussion

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