Lines Matching refs:tflite

23 namespace tflite {  namespace
61 void RegisterSelectedOps(tflite::MutableOpResolver* resolver) { in RegisterSelectedOps()
62 resolver->AddBuiltin(tflite::BuiltinOperator_ADD, in RegisterSelectedOps()
63 tflite::ops::builtin::Register_ADD(), in RegisterSelectedOps()
66 resolver->AddBuiltin(tflite::BuiltinOperator_CONCATENATION, in RegisterSelectedOps()
67 tflite::ops::builtin::Register_CONCATENATION(), in RegisterSelectedOps()
70 resolver->AddBuiltin(tflite::BuiltinOperator_CONV_2D, in RegisterSelectedOps()
71 tflite::ops::builtin::Register_CONV_2D(), in RegisterSelectedOps()
74 resolver->AddBuiltin(tflite::BuiltinOperator_FULLY_CONNECTED, in RegisterSelectedOps()
75 tflite::ops::builtin::Register_FULLY_CONNECTED(), in RegisterSelectedOps()
78 resolver->AddBuiltin(tflite::BuiltinOperator_L2_NORMALIZATION, in RegisterSelectedOps()
79 tflite::ops::builtin::Register_L2_NORMALIZATION(), in RegisterSelectedOps()
82 resolver->AddBuiltin(tflite::BuiltinOperator_MUL, in RegisterSelectedOps()
83 tflite::ops::builtin::Register_MUL()); in RegisterSelectedOps()
84 resolver->AddBuiltin(tflite::BuiltinOperator_RESHAPE, in RegisterSelectedOps()
85 tflite::ops::builtin::Register_RESHAPE()); in RegisterSelectedOps()
86 resolver->AddBuiltin(tflite::BuiltinOperator_SOFTMAX, in RegisterSelectedOps()
87 tflite::ops::builtin::Register_SOFTMAX(), in RegisterSelectedOps()
90 resolver->AddBuiltin(tflite::BuiltinOperator_GATHER, in RegisterSelectedOps()
91 tflite::ops::builtin::Register_GATHER(), in RegisterSelectedOps()
94 resolver->AddBuiltin(tflite::BuiltinOperator_TRANSPOSE, in RegisterSelectedOps()
95 tflite::ops::builtin::Register_TRANSPOSE(), in RegisterSelectedOps()
98 resolver->AddBuiltin(tflite::BuiltinOperator_SUB, in RegisterSelectedOps()
99 tflite::ops::builtin::Register_SUB(), in RegisterSelectedOps()
102 resolver->AddBuiltin(tflite::BuiltinOperator_DIV, in RegisterSelectedOps()
103 tflite::ops::builtin::Register_DIV()); in RegisterSelectedOps()
104 resolver->AddBuiltin(tflite::BuiltinOperator_STRIDED_SLICE, in RegisterSelectedOps()
105 tflite::ops::builtin::Register_STRIDED_SLICE(), in RegisterSelectedOps()
108 resolver->AddBuiltin(tflite::BuiltinOperator_EXP, in RegisterSelectedOps()
109 tflite::ops::builtin::Register_EXP()); in RegisterSelectedOps()
110 resolver->AddBuiltin(tflite::BuiltinOperator_TOPK_V2, in RegisterSelectedOps()
111 tflite::ops::builtin::Register_TOPK_V2(), in RegisterSelectedOps()
114 resolver->AddBuiltin(tflite::BuiltinOperator_SPLIT, in RegisterSelectedOps()
115 tflite::ops::builtin::Register_SPLIT(), in RegisterSelectedOps()
118 resolver->AddBuiltin(tflite::BuiltinOperator_CAST, in RegisterSelectedOps()
119 tflite::ops::builtin::Register_CAST()); in RegisterSelectedOps()
120 resolver->AddBuiltin(tflite::BuiltinOperator_MAXIMUM, in RegisterSelectedOps()
121 tflite::ops::builtin::Register_MAXIMUM(), in RegisterSelectedOps()
124 resolver->AddBuiltin(tflite::BuiltinOperator_MINIMUM, in RegisterSelectedOps()
125 tflite::ops::builtin::Register_MINIMUM(), in RegisterSelectedOps()
128 resolver->AddBuiltin(tflite::BuiltinOperator_NEG, in RegisterSelectedOps()
129 tflite::ops::builtin::Register_NEG()); in RegisterSelectedOps()
130 resolver->AddBuiltin(tflite::BuiltinOperator_SLICE, in RegisterSelectedOps()
131 tflite::ops::builtin::Register_SLICE(), in RegisterSelectedOps()
134 resolver->AddBuiltin(tflite::BuiltinOperator_LOG, in RegisterSelectedOps()
135 tflite::ops::builtin::Register_LOG()); in RegisterSelectedOps()
136 resolver->AddBuiltin(tflite::BuiltinOperator_SUM, in RegisterSelectedOps()
137 tflite::ops::builtin::Register_SUM()); in RegisterSelectedOps()
138 resolver->AddBuiltin(tflite::BuiltinOperator_PACK, in RegisterSelectedOps()
139 tflite::ops::builtin::Register_PACK(), in RegisterSelectedOps()
142 resolver->AddBuiltin(tflite::BuiltinOperator_DEQUANTIZE, in RegisterSelectedOps()
143 tflite::ops::builtin::Register_DEQUANTIZE(), in RegisterSelectedOps()
146 resolver->AddBuiltin(tflite::BuiltinOperator_MEAN, in RegisterSelectedOps()
147 tflite::ops::builtin::Register_MEAN()); in RegisterSelectedOps()
150 void RegisterSelectedOps(tflite::MutableOpResolver* resolver) { in RegisterSelectedOps()
151 resolver->AddBuiltin(tflite::BuiltinOperator_FULLY_CONNECTED, in RegisterSelectedOps()
152 tflite::ops::builtin::Register_FULLY_CONNECTED()); in RegisterSelectedOps()
158 inline std::unique_ptr<tflite::OpResolver> BuildOpResolver() { in BuildOpResolver()
160 std::unique_ptr<tflite::MutableOpResolver> resolver( in BuildOpResolver()
161 new tflite::MutableOpResolver); in BuildOpResolver()
164 std::unique_ptr<tflite::ops::builtin::BuiltinOpResolver> resolver( in BuildOpResolver()
165 new tflite::ops::builtin::BuiltinOpResolver); in BuildOpResolver()
169 tflite::ops::custom::Register_DISTANCE_DIVERSIFICATION()); in BuildOpResolver()
171 tflite::ops::custom::Register_TEXT_ENCODER()); in BuildOpResolver()
173 tflite::ops::custom::Register_TOKEN_ENCODER()); in BuildOpResolver()
175 return std::unique_ptr<tflite::OpResolver>(std::move(resolver)); in BuildOpResolver()
178 std::unique_ptr<const tflite::FlatBufferModel> TfLiteModelFromModelSpec( in TfLiteModelFromModelSpec()
179 const tflite::Model* model_spec) { in TfLiteModelFromModelSpec()
180 std::unique_ptr<const tflite::FlatBufferModel> model( in TfLiteModelFromModelSpec()
181 tflite::FlatBufferModel::BuildFromModel(model_spec)); in TfLiteModelFromModelSpec()
189 std::unique_ptr<const tflite::FlatBufferModel> TfLiteModelFromBuffer( in TfLiteModelFromBuffer()
191 const tflite::Model* model = in TfLiteModelFromBuffer()
192 flatbuffers::GetRoot<tflite::Model>(model_spec_buffer->data()); in TfLiteModelFromBuffer()
202 std::unique_ptr<const tflite::FlatBufferModel> model) in TfLiteModelExecutor()
205 std::unique_ptr<tflite::Interpreter> TfLiteModelExecutor::CreateInterpreter() in CreateInterpreter()
207 std::unique_ptr<tflite::Interpreter> interpreter; in CreateInterpreter()
208 tflite::InterpreterBuilder(*model_, *resolver_)(&interpreter); in CreateInterpreter()
215 tflite::Interpreter* interpreter) const { in SetInput()
216 tflite::DynamicBuffer buf; in SetInput()
225 std::vector<tflite::StringRef> TfLiteModelExecutor::Output( in Output()
226 const int output_index, const tflite::Interpreter* interpreter) const { in Output()
229 const int num_strings = tflite::GetStringCount(output_tensor); in Output()
230 std::vector<tflite::StringRef> output(num_strings); in Output()
232 output[i] = tflite::GetString(output_tensor, i); in Output()
239 const int output_index, const tflite::Interpreter* interpreter) const { in Output()
241 for (const tflite::StringRef& s : in Output()
242 Output<tflite::StringRef>(output_index, interpreter)) { in Output()