---
title: "init(shape:)"
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/mlcupsamplelayer/init(shape:)"
---

# init(shape:)

Creates an upsample layer with the shape you specify.

## Declaration

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

## Parameters

- `shape`: An array that contains the dimensions of the result tensor.

## See Also

### Creating Upsample Layers

- [init(shape:sampleMode:alignsCorners:)](mlcompute/mlcupsamplelayer/init(shape:samplemode:alignscorners:).md)
- [MLCSampleMode](mlcompute/mlcsamplemode.md)
