public static class Interpreter.Options extends Object
Constructor and Description |
---|
Options() |
Modifier and Type | Method and Description |
---|---|
Interpreter.Options |
addDelegate(Delegate delegate)
Adds a
Delegate to be applied during interpreter creation. |
Interpreter.Options |
setAllowBufferHandleOutput(boolean allow)
Advanced: Set if buffer handle output is allowed.
|
Interpreter.Options |
setAllowFp16PrecisionForFp32(boolean allow)
Sets whether to allow float16 precision for FP32 calculation when possible.
|
Interpreter.Options |
setNumThreads(int numThreads)
Sets the number of threads to be used for ops that support multi-threading.
|
Interpreter.Options |
setUseNNAPI(boolean useNNAPI)
Sets whether to use NN API (if available) for op execution.
|
public Interpreter.Options setNumThreads(int numThreads)
public Interpreter.Options setUseNNAPI(boolean useNNAPI)
public Interpreter.Options setAllowFp16PrecisionForFp32(boolean allow)
public Interpreter.Options addDelegate(Delegate delegate)
Delegate
to be applied during interpreter creation.
WARNING: This is an experimental interface that is subject to change.
public Interpreter.Options setAllowBufferHandleOutput(boolean allow)
When a Delegate
supports hardware acceleration, the interpreter will make the data
of output tensors available in the CPU-allocated tensor buffers by default. If the client can
consume the buffer handle directly (e.g. reading output from OpenGL texture), it can set this
flag to false, avoiding the copy of data to the CPU buffer. The delegate documentation should
indicate whether this is supported and how it can be used.
WARNING: This is an experimental interface that is subject to change.
Copyright © 2022. All rights reserved.