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

# init(repeating:shape:scalarType:)

Creates a tensor with the specified shape and a single, repeated scalar value.

## Declaration

```swift
init<Scalar>(repeating repeatedValue: Scalar, shape: [Int], scalarType: Scalar.Type = Scalar.self) where Scalar : MLTensorScalar
```

## Parameters

- `repeatedValue`: The scalar value to repeat.
- `shape`: The shape of the tensor.
- `scalarType`: The scalar type.

## See Also

### Creating a tensor

- [init(_:)](coreml/mltensor/init(_:).md)
- [init(_:alongAxis:)](coreml/mltensor/init(_:alongaxis:).md)
- [init(_:scalarType:)](coreml/mltensor/init(_:scalartype:).md)
- [init(bytesNoCopy:shape:scalarType:deallocator:)](coreml/mltensor/init(bytesnocopy:shape:scalartype:deallocator:).md)
- [init(concatenating:alongAxis:)](coreml/mltensor/init(concatenating:alongaxis:).md)
- [init(linearSpaceFrom:through:count:)](coreml/mltensor/init(linearspacefrom:through:count:).md)
- [init(linearSpaceFrom:through:count:scalarType:)](coreml/mltensor/init(linearspacefrom:through:count:scalartype:).md)
- [init(ones:scalarType:)](coreml/mltensor/init(ones:scalartype:).md)
- [init(randomNormal:mean:standardDeviation:seed:scalarType:)](coreml/mltensor/init(randomnormal:mean:standarddeviation:seed:scalartype:).md)
- [init(randomUniform:in:seed:scalarType:)](coreml/mltensor/init(randomuniform:in:seed:scalartype:).md)
- [init(rangeFrom:to:by:)](coreml/mltensor/init(rangefrom:to:by:).md)
- [init(rangeFrom:to:by:scalarType:)](coreml/mltensor/init(rangefrom:to:by:scalartype:).md)
- [init(repeating:shape:)](coreml/mltensor/init(repeating:shape:).md)
- [init(shape:data:scalarType:)](coreml/mltensor/init(shape:data:scalartype:).md)
- [init(shape:scalars:)](coreml/mltensor/init(shape:scalars:).md)
