---
title: "init(_:dataLayout:stride:)"
framework: accelerate
role: symbol
role_heading: Initializer
path: "accelerate/bnns/shape/init(_:datalayout:stride:)"
---

# init(_:dataLayout:stride:)

Returns a new shape with the specified size, data layout, and stride.

## Declaration

```swift
init(_ size: [Int], dataLayout: BNNS.DataLayout? = nil, stride: [Int]? = nil)
```

## Parameters

- `size`: An array that specifies the number of values in each dimension.
- `dataLayout`: The number of dimensions of the array, and how it stores the data.
- `stride`: An array specifying the increment, in values, between a value and the next in each dimension.

## Discussion

Discussion Pass nil to dataLayout to have init(size:dataLayout:stride:) return a shape with the default layout for the rank that’s equal to the count of size. The default layouts for each dimensionality are: This initializer interprets a stride value of 0 to mean that values are contiguous for that axis.

## See Also

### Creating a Shape

- [init(arrayLiteral:)](accelerate/bnns/shape/init(arrayliteral:).md)
