Builder for BaseOptions
.
Public Constructors
Builder()
|
Public Methods
abstract BaseOptions |
build()
|
abstract BaseOptions.Builder | |
abstract BaseOptions.Builder |
setNumThreads(int numThreads)
Sets the number of threads to be used for TFLite ops that support multi-threading when
running inference with CPU.
|
BaseOptions.Builder |
useGpu()
Uses GPU for inference.
|
BaseOptions.Builder |
useNnapi()
Uses NNAPI for inference.
|
Inherited Methods
Public Constructors
public Builder ()
Public Methods
public abstract BaseOptions.Builder setComputeSettings (ComputeSettings computeSettings)
Sets the advanced accelerator options.
Note: this method will override those highlevel API to choose an delegate, such as useGpu()
and useNnapi()
.
Parameters
computeSettings |
---|
public abstract BaseOptions.Builder setNumThreads (int numThreads)
Sets the number of threads to be used for TFLite ops that support multi-threading when running inference with CPU. Defaults to -1.
numThreads
should be greater than 0 or equal to -1. Setting numThreads to -1 has
the effect to let TFLite runtime set the value.
Parameters
numThreads |
---|
public BaseOptions.Builder useGpu ()
Uses GPU for inference. The advanced GPU configuration settings will be set to default values.
Note: this method will override the settings from setComputeSettings(ComputeSettings)
.
To manipulate the advanced GPU configuration settings, use setComputeSettings(ComputeSettings)
.
public BaseOptions.Builder useNnapi ()
Uses NNAPI for inference. The advanced NNAPI configuration settings will be set to default values.
Note: this method will override the settings from setComputeSettings(ComputeSettings)
.
To manipulate the advanced NNAPI configuration settings, use setComputeSettings(ComputeSettings)
.