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

# init(data:shape:)

Creates a shaped array from a block of data and a shape.

## Declaration

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

## Parameters

- `data`: The block of data that holds the contents of the shaped array.
- `shape`: The shape of the array.

## See Also

### Creating a shaped array from data

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