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

# init(repeating:shape:)

Creates a shaped array type that initializes every element to the same value.

## Declaration

```swift
init(repeating value: Self.Scalar, shape: [Int])
```

## Parameters

- `value`: A scalar value. The initializer assigns every element in the shaped array to value.
- `shape`: An integer array. Each element represents the size of the shaped array’s corresponding dimension.

## See Also

### Creating a shaped array type

- [init(scalars:shape:)](coreml/mlshapedarrayprotocol/init(scalars:shape:).md)
- [init(identityMatrixOfSize:)](coreml/mlshapedarrayprotocol/init(identitymatrixofsize:).md)
- [init(randomScalarsIn:shape:)](coreml/mlshapedarrayprotocol/init(randomscalarsin:shape:).md)
- [init(bytesNoCopy:shape:deallocator:)](coreml/mlshapedarrayprotocol/init(bytesnocopy:shape:deallocator:).md)
- [init(bytesNoCopy:shape:strides:deallocator:)](coreml/mlshapedarrayprotocol/init(bytesnocopy:shape:strides:deallocator:).md)
- [init(unsafeUninitializedShape:initializingWith:)](coreml/mlshapedarrayprotocol/init(unsafeuninitializedshape:initializingwith:).md)
