Contents

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

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 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.

See Also

Specifying and querying a tensor’s properties