---
title: "BNNSGraphTensorFillStrides(_:_:_:_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/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.

## Declaration

```swift
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 doc://com.apple.accelerate/documentation/Accelerate/BNNSTensor/rank elements contain the strides that BNNS requires.

## Return Value

Return Value 0 on success, nonzero on failure.

## Discussion

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.

## See Also

### Specifying and querying a tensor’s properties

- [BNNSTensor](accelerate/bnnstensor.md)
- [BNNSTensorGetAllocationSize(_:)](accelerate/bnnstensorgetallocationsize(_:).md)
- [BNNSGraphContextGetTensor(_:_:_:_:_:)](accelerate/bnnsgraphcontextgettensor(_:_:_:_:_:).md)
