<!--
{
  "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_context_t",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@SA@bnns_graph_context_t"
  },
  "title" : "bnns_graph_context_t"
}
-->

# bnns_graph_context_t

An object that wraps a compiled graph object.

```
struct bnns_graph_context_t
```

## Overview

The [`bnns_graph_context_t`](/documentation/Accelerate/bnns_graph_context_t) object wraps a [`bnns_graph_t`](/documentation/Accelerate/bnns_graph_t) instance and adds mutable data storage. BNNS requires mutability to support dynamic shapes and other execution objects.

You must ensure that the underlying [`bnns_graph_t`](/documentation/Accelerate/bnns_graph_t) instance remains valid throughout the lifetime of the context.

## Topics

### Initializing a context

[`init()`](/documentation/Accelerate/bnns_graph_context_t/init())

Creates an empty graph context structure.

[`init(data:size:)`](/documentation/Accelerate/bnns_graph_context_t/init(data:size:))

Creates a graph context structure from the specified opaque graph context object.

### Specifying a context’s properties

[`data`](/documentation/Accelerate/bnns_graph_context_t/data)

A pointer to the opaque graph context object.

[`size`](/documentation/Accelerate/bnns_graph_context_t/size)

The size, in bytes, of the opaque graph context object.



---

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)