ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more

InterpreterApi.Options

public static class InterpreterApi.Options
Known Direct Subclasses

An options class for controlling runtime interpreter behavior.

Public Constructors

Public Methods

InterpreterApi.Options
setCancellable(boolean allow)
Advanced: Set if the interpreter is able to be cancelled.
InterpreterApi.Options
setNumThreads(int numThreads)
Sets the number of threads to be used for ops that support multi-threading.
InterpreterApi.Options
setUseNNAPI(boolean useNNAPI)
Sets whether to use NN API (if available) for op execution.

Inherited Methods

Public Constructors

public Options ()

Public Methods

public InterpreterApi.Options setCancellable (boolean allow)

Advanced: Set if the interpreter is able to be cancelled.

Parameters
allow

public InterpreterApi.Options setNumThreads (int numThreads)

Sets the number of threads to be used for ops that support multi-threading.

numThreads should be >= -1. Setting numThreads to 0 has the effect to disable multithreading, which is equivalent to setting numThreads to 1. If unspecified, or set to the value -1, the number of threads used will be implementation-defined and platform-dependent.

Parameters
numThreads

public InterpreterApi.Options setUseNNAPI (boolean useNNAPI)

Sets whether to use NN API (if available) for op execution. Defaults to false (disabled).

Parameters
useNNAPI