<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/bnns_graph_shape_t/init(rank:shape:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:So18bnns_graph_shape_ta4rank0C0ABSi_Spys6UInt64VGSgtcfc"
  },
  "title" : "init(rank:shape:)"
}
-->

# init(rank:shape:)

Creates a shape structure with the specified rank and dimensions.

```
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 [`rank`](/documentation/Accelerate/bnns_graph_shape_t/rank) that contains the sizes of each dimension.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)