Delegate
for GPU inference.
Note: When calling Interpreter.Options.addDelegate()
and Interpreter.run()
,
the caller must have an EGLContext
in the current thread and Interpreter.run()
must be called from the same EGLContext
. If an EGLContext
does
not exist, the delegate will internally create one, but then the developer must ensure that
Interpreter.run()
is always called from the same thread in which Interpreter.Options.addDelegate()
was called.
class | GpuDelegate.Options |
This class is deprecated. Use GpuDelegateFactory.Options instead.
|
GpuDelegate(GpuDelegateFactory.Options options)
|
|
void |
close()
Frees TFLite resources in C runtime.
|
long |
getNativeHandle()
Returns a native handle to the TensorFlow Lite delegate implementation.
|
Frees TFLite resources in C runtime.
User is expected to call this method explicitly.
Returns a native handle to the TensorFlow Lite delegate implementation.
Note: The Java Delegate
maintains ownership of the native delegate instance, and
must ensure its existence for the duration of usage with any InterpreterApi
instance.
Note: the native delegate instance may not be created until the delegate has been attached to an interpreter, so this method should not be called until after an interpreter has been constructed with this delegate.