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.
Nested Classes
Public Constructors
| * | |
| * | GpuDelegate
()
|
Public Methods
| void | |
| long |
Inherited Methods
Public Constructors
public GpuDelegate ( GpuDelegateFactory.Options options)
Parameters
public GpuDelegate ()
Public Methods
public void close ()
Frees TFLite resources in C runtime.
User is expected to call this method explicitly.
public long getNativeHandle ()
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.
Returns
- The native delegate handle. In C/C++, this should be a pointer to 'TfLiteOpaqueDelegate'.

