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

# BNNSGraphTensorFillStrides(_:_:_:_:)

Sets the stride of the specifed tensor for compatibility with the given model’s input or output argument based on its current shape.

```
func BNNSGraphTensorFillStrides(_ graph: bnns_graph_t, _ function: UnsafePointer<CChar>?, _ argument: UnsafePointer<CChar>, _ tensor: UnsafeMutablePointer<BNNSTensor>) -> Int32
```

## Parameters

`graph`

The compiled graph object.

`function`

The function. Specify as `nil` if the graph only contains one function.

`argument`

The name of the input or output argument.

`tensor`

The tensor. On output, the first [`rank`](/documentation/Accelerate/BNNSTensor/rank) elements contain the strides that BNNS requires.

## Return Value

`0` on success, nonzero on failure.

## Discussion

Call this function to fill the strides of a buffer according to the specification of the compiled graph’s model.

This function requires that you specify the tensor’s sizes. That is, they aren’t less than zero.

---

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)