STT-tensorflow/tensorflow/lite/delegates/external
Karim Nosir 5d6777317c Fix typo in external delegate
PiperOrigin-RevId: 327747756
Change-Id: I4a514fa45980a3b29cd35b054af59cc9607b9bb5
2020-08-20 20:42:49 -07:00
..
BUILD tflite: Add SharedLibrary class 2020-07-08 18:40:15 -07:00
external_delegate.cc tflite: Add SharedLibrary class 2020-07-08 18:40:15 -07:00
external_delegate.h
README.md Fix typo in external delegate 2020-08-20 20:42:49 -07:00

What is an External Delegate?

An external delegate is a special Tensorflow Lite delegate that is simply initialized from loading a dynamic library which encapsulates an actual Tensorflow Lite delegate implementation. The actual delegate exposes the following two creation and deletion C APIs:

  • tflite_plugin_create_delegate (declaration seen below) creates a delegate object based on provided key-value options. It may return NULL to indicate an error with the detailed information reported by calling report_error if provided. Each option key and value should be null-terminated.
TfLiteDelegate* tflite_plugin_create_delegate(
  char** options_keys, char** options_values, size_t num_options,
  void (*report_error)(const char *))
  • tflite_plugin_destroy_delegate (declaration seen below) destroys the delegate object that is created by the previous API. NULL as an argument value is allowed.
void tflite_plugin_destroy_delegate(TfLiteDelegate* delegate)

The external delegate provides an opaque and transparent way to utilize a Tensorflow Lite delegate when performing inference. In other words, one may replace the actual Tensorflow Lite delegate by simply updating the dynamic library without changing the application code. We developed this mainly for delegate evaluation.

Note, this delegate is the corresponding C++ implementation to the one for Tensorflow Lite Python binding as shown here.