InterpreterApi.Options

class InterpreterApi.Options

An options class for controlling runtime interpreter behavior.

Summary

Nested types

Enum to represent where to get the TensorFlow Lite runtime implementation from.

Public constructors

Public functions

Boolean
Boolean

Advanced: Returns whether the interpreter is able to be cancelled.

InterpreterApi.Options!

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

InterpreterApi.Options!
setUseXNNPACK(useXNNPACK: Boolean)

Enable or disable an optimized set of CPU kernels (provided by XNNPACK).

Public constructors

Options

Options()

Options

Options(other: InterpreterApi.Options!)

Public functions

getUseXNNPACK

fun getUseXNNPACK(): Boolean

isCancellable

fun isCancellable(): Boolean

Advanced: Returns whether the interpreter is able to be cancelled.

Interpreters may have an experimental API setCancelled(boolean). If this interpreter is cancellable and such a method is invoked, a cancellation flag will be set to true. The interpreter will check the flag between Op invocations, and if it's true, the interpreter will stop execution. The interpreter will remain a cancelled state until explicitly "uncancelled" by setCancelled(false).

setCancellable

fun setCancellable(allow: Boolean): InterpreterApi.Options!

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

Interpreters may have an experimental API setCancelled(boolean). If this interpreter is cancellable and such a method is invoked, a cancellation flag will be set to true. The interpreter will check the flag between Op invocations, and if it's true, the interpreter will stop execution. The interpreter will remain a cancelled state until explicitly "uncancelled" by setCancelled(false).

setUseXNNPACK

fun setUseXNNPACK(useXNNPACK: Boolean): InterpreterApi.Options!

Enable or disable an optimized set of CPU kernels (provided by XNNPACK). Enabled by default.

Public properties

numThreads

var numThreadsInt