Contents

BNNSGraphContextGetTensor(_:_:_:_:_:)

Sets the properties of a tensor for the specified function argument.

Declaration

func BNNSGraphContextGetTensor(_ context: bnns_graph_context_t, _ function: UnsafePointer<CChar>?, _ argument: UnsafePointer<CChar>, _ fill_known_dynamic_shapes: Bool, _ tensor: UnsafeMutablePointer<BNNSTensor>) -> Int32

Parameters

  • context:

    The graph context.

  • function:

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

  • argument:

    The name of the input or output argument.

  • fill_known_dynamic_shapes:

    A Boolean value that specifies whether the function should replace any dynamic shapes for the next execution of the context. BNNS derives these shapes either from the default shapes in the source model, or from a preceding calls to Bnnsgraphcontextsetdynamicshapes(_:_:_:_:) or Bnnsgraphcontextsetbatchsize(_:_:_:). If BNNS is unable to derive the shapes, the function sets the dimensions to -1.

  • tensor:

    The tensor. On output, all fields apart from Data contain the properties for the specified function argument.

Return Value

0 on success, nonzero on failure.

See Also

Specifying and querying a tensor’s properties