Using weak symbols for the flex delegate allows automatic injection of the delegate simply by adding it as a dependency. See also the strong override in lite/delegates/flex/delegate.cc.
| 53 | // delegate simply by adding it as a dependency. See also the strong override in |
| 54 | // lite/delegates/flex/delegate.cc. |
| 55 | __attribute__((weak)) Interpreter::TfLiteDelegatePtr AcquireFlexDelegate() { |
| 56 | return Interpreter::TfLiteDelegatePtr(nullptr, [](TfLiteDelegate*) {}); |
| 57 | } |
| 58 | #else |
| 59 | Interpreter::TfLiteDelegatePtr (*AcquireFlexDelegate)() = nullptr; |
| 60 | #endif |