10 #include <tensorflow/lite/builtin_ops.h>
11 #include <tensorflow/lite/c/builtin_op_data.h>
12 #include <tensorflow/lite/c/common.h>
13 #include <tensorflow/lite/minimal_logging.h>
14 #include <tensorflow/lite/version.h>
16 #if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 3)
17 #define ARMNN_POST_TFLITE_2_3
20 #if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 4)
21 #define ARMNN_POST_TFLITE_2_4
24 #if TF_MAJOR_VERSION > 2 || (TF_MAJOR_VERSION == 2 && TF_MINOR_VERSION > 5)
25 #define ARMNN_POST_TFLITE_2_5
50 TfLiteStatus
DoPrepare(TfLiteContext* context, TfLiteDelegate* delegate);
74 return instance.get();
77 TfLiteDelegate m_Delegate = {
78 reinterpret_cast<void*
>(
this),
83 kTfLiteDelegateFlagsNone,
97 const TfLiteDelegateParams* parameters,
100 TfLiteStatus
Prepare(TfLiteContext* tfLiteContext);
102 TfLiteStatus
Invoke(TfLiteContext* tfLiteContext, TfLiteNode* tfLiteNode);
105 TfLiteContext* tfLiteContext,
106 TfLiteRegistration* tfLiteRegistration,
107 TfLiteNode* tfLiteNode,
113 std::vector<armnn::BindingPointInfo>& inputBindings,
114 std::vector<armnn::BindingPointInfo>& outputBindings)
115 : m_NetworkId(networkId), m_Runtime(runtime), m_InputBindings(inputBindings), m_OutputBindings(outputBindings)
118 static TfLiteStatus AddInputLayer(
DelegateData& delegateData,
119 TfLiteContext* tfLiteContext,
120 const TfLiteIntArray* inputs,
121 std::vector<armnn::BindingPointInfo>& inputBindings);
123 static TfLiteStatus AddOutputLayer(
DelegateData& delegateData,
124 TfLiteContext* tfLiteContext,
125 const TfLiteIntArray* outputs,
126 std::vector<armnn::BindingPointInfo>& outputBindings);
135 std::vector<armnn::BindingPointInfo> m_InputBindings;
136 std::vector<armnn::BindingPointInfo> m_OutputBindings;