Contents

executeFunction(_:arguments:)

Synchronously executes the specified function with the provided context.

Declaration

func executeFunction(_ function: String? = nil, arguments: inout [BNNSTensor]) throws

Parameters

  • function:

    The specific function to execute. You may set this to nil if there is only one function.

  • arguments:

    The output and input arguments.

Discussion

If the underlying model contains dynamic shaped inputs or outputs, these must be set prior to calling this routine through a call to either setDynamicShapes(_:forFunction:) or setBatchSize(_:forFunction:). Don’t modify the shapes again until this routine has returned.

The same context must only be used by a single thread at a time.