<!--
{
  "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/BNNSGraphContextSetArgumentType(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@BNNSGraphContextSetArgumentType"
  },
  "title" : "BNNSGraphContextSetArgumentType(_:_:)"
}
-->

# BNNSGraphContextSetArgumentType(_:_:)

Specifies the argument type for a graph context.

```
func BNNSGraphContextSetArgumentType(_ context: bnns_graph_context_t, _ argument_type: BNNSGraphArgumentType) -> Int32
```

## Parameters

`context`

The graph context.

`argument_type`

A constant that specifies the argument type.

## Return Value

`0` on success, nonzero on failure.

## Discussion

Some arguments require dynamic strides. In this case, set the graph context’s argument type to [`BNNSGraphArgumentTypeTensor`](/documentation/Accelerate/BNNSGraphArgumentTypeTensor) and pass the arguments to [`BNNSGraphContextExecute(_:_:_:_:_:_:)`](/documentation/Accelerate/BNNSGraphContextExecute(_:_:_:_:_:_:)) as [`BNNSTensor`](/documentation/Accelerate/BNNSTensor) structures.

The default argument type for a graph context is [`BNNSGraphArgumentTypePointer`](/documentation/Accelerate/BNNSGraphArgumentTypePointer).

---

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)