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

# init(scalars:shape:)

Initialize with a sequence and the shape.

## Declaration

```swift
init<S>(scalars: S, shape: [Int]) where Scalar == S.Element, S : Sequence
```

## Parameters

- `scalars`: The initializing sequence.
- `shape`: The shape

## Discussion

Discussion The length of the sequence must not be less than the number of scalars in the shaped array.

## See Also

### Creating a shaped array slice

- [init(scalar:)](coreml/mlshapedarrayslice/init(scalar:).md)
- [init(mutating:shape:)](coreml/mlshapedarrayslice/init(mutating:shape:).md)
