Contents

run(inputs:states:outputViews:)

Runs the function on the provided input values and returns the output values.

Declaration

func run(inputs: borrowing InferenceFunction.Inputs, states: consuming InferenceFunction.MutableViews = MutableViews(), outputViews: consuming InferenceFunction.MutableViews = MutableViews()) async throws -> InferenceFunction.Outputs

Parameters

  • inputs:

    The input values for the function.

  • states:

    The in-out arguments of the function, which the function reads and writes during inference. You must provide views for all states; omitting any state produces an error.

  • outputViews:

    Pre-allocated output values that the function updates during inference. Outputs with a provided view are updated in-place and are not included in the returned Outputs. Outputs without a provided view produce new values in the returned Outputs.

Return Value

The outputs from the function.

Discussion

Any NDArray values in the returned outputs have a row-major contiguous layout.