/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include "tensorflow/lite/core/api/flatbuffer_conversions.h" #include <algorithm> #include <cstddef> #include <cstdint> #include <memory> #include "flatbuffers/flatbuffers.h" // from @flatbuffers #include "flatbuffers/vector.h" // from @flatbuffers #include "tensorflow/lite/core/api/error_reporter.h" #include "tensorflow/lite/core/c/builtin_op_data.h" #include "tensorflow/lite/core/c/common.h" #include "tensorflow/lite/kernels/internal/compatibility.h" #include "tensorflow/lite/schema/schema_generated.h" namespace tflite { namespace { // Utility class for safely allocating POD data. This is useful for avoiding // leaks in cases where op params are allocated but fail to propagate to the // parsed op data (e.g., when model parameters are invalid). class SafeBuiltinDataAllocator { … }; // All the Parse functions take some pointers as params and this function has // the common DCHECKs to catch if any of those are nullptr. void CheckParsePointerParams(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // Copies the contents from the flatbuffer int vector `flatbuffer` into the // int array `buffer`. `flat_vector` and `buffer` represent the same // configuration operation for a given operation. template <typename DataType = int32_t> static TfLiteStatus FlatBufferIntVectorToArray( int max_size_of_buffer, const flatbuffers::Vector<DataType>* flat_vector, DataType* buffer, ErrorReporter* error_reporter, const char* op_name) { … } // Converts the flatbuffer activation to what is used at runtime. TfLiteFusedActivation ConvertActivation(ActivationFunctionType activation) { … } // Converts the flatbuffer padding enum to what is used at runtime. TfLitePadding ConvertPadding(Padding padding) { … } // Converts the flatbuffer mirror padding enum to what is used at runtime. TfLiteMirrorPaddingMode ConvertMirrorPadding(MirrorPadMode padding) { … } TfLiteRngAlgorithm ConvertRngAlgorithm(RngAlgorithm algorithm) { … } #ifndef TF_LITE_STATIC_MEMORY TfLiteStatus ParseOpDataTfLite(const Operator* op, BuiltinOperator op_type, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // NOLINT[readability/fn_size] #endif // !defined(TF_LITE_STATIC_MEMORY) } // namespace TfLiteStatus ConvertTensorType(TensorType tensor_type, TfLiteType* type, ErrorReporter* error_reporter) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseAbs(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseAdd(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseAddN(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseArgMax(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseArgMin(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseAssignVariable(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseBatchMatMul(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseBatchToSpaceNd(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseBroadcastArgs(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseBroadcastTo(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseCallOnce(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseCast(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseCeil(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseConcatenation(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseConv2D(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseCumsum(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseCos(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseDepthToSpace(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseDepthwiseConv2D(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseDequantize(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseDiv(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseElu(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseEmbeddingLookup(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseEqual(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseExp(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseExpandDims(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseFill(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseFloor(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseFloorDiv(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseFloorMod(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseFullyConnected(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseGather(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseGatherNd(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseGreater(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseGreaterEqual(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseHardSwish(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseIf(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseL2Normalization(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseLeakyRelu(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseLess(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseLessEqual(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseLog(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseLogicalAnd(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseLogicalNot(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseLogicalOr(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseLogistic(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseLogSoftmax(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseLSTM(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseMaximum(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseMinimum(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseMirrorPad(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseMul(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseNeg(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseNotEqual(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParsePack(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParsePad(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParsePadV2(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParsePool(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParsePow(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParsePrelu(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseQuantize(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseReadVariable(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseReducer(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseRelu(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseRelu6(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseReshape(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseResizeBilinear(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseResizeNearestNeighbor(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseStablehloReduceWindow(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseStablehloScatter(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseStablehloRngBitGenerator(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseStablehloGather(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseStablehloPad(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseStablehloComposite(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseRound(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseRsqrt(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseSelectV2(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseShape(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseSin(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseSlice(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseSoftmax(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseSpaceToBatchNd(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseSpaceToDepth(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseSplit(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseSplitV(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseUnidirectionalSequenceLSTM(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseSqueeze(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseSqrt(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseSquare(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseSquaredDifference(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseStridedSlice(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseSub(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseSvdf(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseTanh(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseTranspose(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseTransposeConv(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseUnpack(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseVarHandle(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } TfLiteStatus ParseWhile(const Operator* op, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseZerosLike(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseBitwiseXor(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } // We have this parse function instead of directly returning kTfLiteOk from the // switch-case in ParseOpData because this function is used as part of the // selective registration for the OpResolver implementation in micro. TfLiteStatus ParseRightShift(const Operator*, ErrorReporter*, BuiltinDataAllocator*, void**) { … } TfLiteStatus ParseOpData(const Operator* op, BuiltinOperator op_type, ErrorReporter* error_reporter, BuiltinDataAllocator* allocator, void** builtin_data) { … } } // namespace tflite