---
title: "allocate(repeating:shape:stride:)"
framework: accelerate
role: symbol
role_heading: Type Method
path: "accelerate/bnnstensor/allocate(repeating:shape:stride:)"
---

# allocate(repeating:shape:stride:)

Creates a BNNSTensor filled with the specified scalar value.

## Declaration

```swift
static func allocate<T>(repeating repeatedValue: T, shape: [Int], stride: [Int]) -> BNNSTensor where T : BNNSScalar
```

## Parameters

- `repeatedValue`: The value that the function uses for a fillable element.
- `shape`: The shape of the tensor.
- `stride`: The stride of the tensor.
