Contents

execute(inputsData:batchSize:options:completionHandler:)

Executes the inference graph with the inputs data, batch size, execution options, and completion handler you specify.

Declaration

func execute(inputsData: [String : MLCTensorData], batchSize: Int, options: MLCExecutionOptions = [], completionHandler: MLCGraphCompletionHandler? = nil) -> Bool

Parameters

  • inputsData:

    A dictionary that contains input data.

  • batchSize:

    The batch size.

  • options:

    The execution options.

  • completionHandler:

    The completion handler.

Return Value

true if the execution was successful.

Discussion

When executing an inference graph, if an optimizer is specified, the optimizer update is applied.

For variable length sequences for LSTMs/RNNs, use the key “sortedSequenceLengths” and pass in tensor data created by using one of the MLCTensor sequence length initializers as the value.

If synchronous is specified in options, this method returns after the graph is executed. Otherwise, this method returns after the graph is queued for execution. The completion handler is called after the graph has finished execution.

See Also

Executing Inference Graphs