---
title: "init(data:shape:)"
framework: coreml
role: symbol
role_heading: Initializer
path: "coreml/mlshapedarrayslice/init(data:shape:)"
---

# init(data:shape:)

Creates a shaped array with a defined data and shape.

## Declaration

```swift
init(data: Data, shape: [Int])
```

## Parameters

- `data`: A block of data that initializes the array.
- `shape`: The shape of the array.

## See Also

### Creating a shaped array slice with data

- [init(data:shape:strides:)](coreml/mlshapedarrayslice/init(data:shape:strides:).md)
