tflite::OpResolver

This is an abstract class.

#include <op_resolver.h>

Abstract interface that returns TfLiteRegistrations given op codes or custom op names.

Summary

This is the mechanism that ops being referenced in the flatbuffer model are mapped to executable function pointers (TfLiteRegistrations).

The lifetime of the TfLiteRegistration object whose address is returned by FindOp must exceed the lifetime of any InterpreterBuilder or Interpreter created with this OpResolver. Likewise the lifetime of the TfLiteRegistrationExternal object referenced from the TfLiteRegistration object, if any, must exceed the lifetime of any InterpreterBuilder or Interpreter created with this OpResolver.

Inheritance

Direct Known Subclasses:tflite::MutableOpResolver

Constructors and Destructors

OpResolver()
OpResolver(const OpResolver & other)
~OpResolver()

Public types

TfLiteDelegateCreator using
std::function< std::unique_ptr< TfLiteDelegate, void(*)(TfLiteDelegate *)>(TfLiteContext *)>
TfLiteDelegateCreators using
std::vector< TfLiteDelegateCreator >
TfLiteDelegatePtrVector using
std::vector< std::unique_ptr< TfLiteDelegate, void(*)(TfLiteDelegate *)>>
TfLiteOpaqueDelegateCreator using
std::function< TfLiteOpaqueDelegatePtr(int)>
TfLiteOpaqueDelegateCreators using
std::vector< TfLiteOpaqueDelegateCreator >
TfLiteOpaqueDelegatePtr using
std::unique_ptr< TfLiteOpaqueDelegate, void(*)(TfLiteOpaqueDelegate *)>

Public functions

FindOp(tflite::BuiltinOperator op, int version) const =0
virtual const TfLiteRegistration *
Finds the op registration for a builtin operator by enum code.
FindOp(const char *op, int version) const =0
virtual const TfLiteRegistration *
Finds the op registration of a custom operator by op name.
GetDelegateCreators() const
virtual TfLiteDelegateCreators
GetDelegates(int num_threads) const
virtual TfLiteDelegatePtrVector
GetOpaqueDelegateCreators() const
virtual TfLiteOpaqueDelegateCreators

Public types

TfLiteDelegateCreator

std::function< std::unique_ptr< TfLiteDelegate, void(*)(TfLiteDelegate *)>(TfLiteContext *)> TfLiteDelegateCreator

TfLiteDelegateCreators

std::vector< TfLiteDelegateCreator > TfLiteDelegateCreators

TfLiteDelegatePtrVector

std::vector< std::unique_ptr< TfLiteDelegate, void(*)(TfLiteDelegate *)>> TfLiteDelegatePtrVector

TfLiteOpaqueDelegateCreator

std::function< TfLiteOpaqueDelegatePtr(int)> TfLiteOpaqueDelegateCreator

TfLiteOpaqueDelegateCreators

std::vector< TfLiteOpaqueDelegateCreator > TfLiteOpaqueDelegateCreators

TfLiteOpaqueDelegatePtr

std::unique_ptr< TfLiteOpaqueDelegate, void(*)(TfLiteOpaqueDelegate *)> TfLiteOpaqueDelegatePtr

Public functions

FindOp

virtual const TfLiteRegistration * FindOp(
  tflite::BuiltinOperator op,
  int version
) const =0

Finds the op registration for a builtin operator by enum code.

FindOp

virtual const TfLiteRegistration * FindOp(
  const char *op,
  int version
) const =0

Finds the op registration of a custom operator by op name.

GetDelegateCreators

virtual TfLiteDelegateCreators GetDelegateCreators() const 

GetDelegates

virtual TfLiteDelegatePtrVector GetDelegates(
  int num_threads
) const 

GetOpaqueDelegateCreators

virtual TfLiteOpaqueDelegateCreators GetOpaqueDelegateCreators() const 

OpResolver

 OpResolver()=default

OpResolver

 OpResolver(
  const OpResolver & other
)=default

~OpResolver

virtual  ~OpResolver()=default