---
title: "allocate(repeating:shape:batchSize:)"
framework: accelerate
role: symbol
role_heading: Type Method
path: "accelerate/bnnsndarraydescriptor/allocate(repeating:shape:batchsize:)"
---

# allocate(repeating:shape:batchSize:)

Returns a new n-dimensional array descriptor that’s initialized with a single, repeated scalar value.

## Declaration

```swift
static func allocate<T>(repeating repeatedValue: T, shape: BNNS.Shape, batchSize: Int = 1) -> BNNSNDArrayDescriptor where T : BNNSScalar
```

## Parameters

- `repeatedValue`: The element to repeat.
- `shape`: The shape of n-dimensional array descriptor.
- `batchSize`: The number of batches of data.

## See Also

### Allocating and Deallocating Memory

- [allocate(initializingFrom:shape:batchSize:)](accelerate/bnnsndarraydescriptor/allocate(initializingfrom:shape:batchsize:).md)
- [allocate(randomUniformUsing:range:shape:batchSize:)](accelerate/bnnsndarraydescriptor/allocate(randomuniformusing:range:shape:batchsize:)-2rorb.md)
- [allocate(randomUniformUsing:range:shape:batchSize:)](accelerate/bnnsndarraydescriptor/allocate(randomuniformusing:range:shape:batchsize:)-761hg.md)
- [allocate(randomIn:shape:batchSize:)](accelerate/bnnsndarraydescriptor/allocate(randomin:shape:batchsize:)-1697a.md)
- [allocate(randomIn:shape:batchSize:)](accelerate/bnnsndarraydescriptor/allocate(randomin:shape:batchsize:)-5a2p2.md)
- [allocate(randomIn:using:shape:batchSize:)](accelerate/bnnsndarraydescriptor/allocate(randomin:using:shape:batchsize:)-5kbi8.md)
- [allocate(randomIn:using:shape:batchSize:)](accelerate/bnnsndarraydescriptor/allocate(randomin:using:shape:batchsize:)-3w6ig.md)
- [allocateUninitialized(scalarType:shape:batchSize:)](accelerate/bnnsndarraydescriptor/allocateuninitialized(scalartype:shape:batchsize:).md)
- [deallocate()](accelerate/bnnsndarraydescriptor/deallocate().md)
