---
title: "init(rank:shape:)"
framework: accelerate
role: symbol
role_heading: Initializer
path: "accelerate/bnns_graph_shape_t/init(rank:shape:)"
---

# init(rank:shape:)

Creates a shape structure with the specified rank and dimensions.

## Declaration

```swift
init(rank: Int, shape: UnsafeMutablePointer<UInt64>?)
```

## Parameters

- `rank`: The rank of the tensor and number of elements in array shape.
- `shape`: Array with a count of doc://com.apple.accelerate/documentation/Accelerate/bnns_graph_shape_t/rank that contains the sizes of each dimension.

## See Also

### Initializing a graph shape

- [init()](accelerate/bnns_graph_shape_t/init().md)
