2 * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __DATA_LOOKUP_H__
18 #define __DATA_LOOKUP_H__
20 #include <mio/tflite/schema_generated.h>
21 #include <mio/circle/schema_generated.h>
23 namespace tflite2circle
27 * @brief Returns circle builtin_code according to tflite.
29 * @note You can see a list of currently supported BuiltinOperator in TFLOperator.lst file.
31 circle::BuiltinOperator get_circle_builtin_code(tflite::BuiltinOperator tfl_bop);
34 * @brief Returns circle TensorType according to tflite.
36 * @note You can see a list of currently supported TensorType in TFLTensorType.lst file.
38 circle::TensorType get_circle_tensortype(tflite::TensorType tfl_tt);
41 * @brief Returns circle Padding enum according to tflite.
43 circle::Padding get_circle_padding(tflite::Padding tfl_p);
46 * @brief Returns circle ActivationFunctionType according to tflite.
48 * @note You can see a list of currently supported ActivationFunctionType in
49 * TFLActivationFunctionType.lst file.
51 circle::ActivationFunctionType
52 get_circle_activation_function_type(tflite::ActivationFunctionType tfl_aft);
55 * @brief Returns circle builtin_options according to tflite.
57 * @note You can see a list of currently supported BuiltinOptions in
58 * TFLBuiltinOptions.lst file.
60 * This function calls the build_circle_##BuiltinOptions internally(e.g.
61 * build_circle_AbsOptions, build_circle_AddOptions, etc.), so refer to it for a more
62 * detailed implementation.
64 flatbuffers::Offset<void> get_circle_builtin_options(flatbuffers::FlatBufferBuilder &fb,
65 const tflite::Operator *op);
68 * @brief Returns circle builtin_options_type according to tflite.
70 * @note You can see a list of currently supported BuiltinOptions in TFLBuiltinOptions.lst file.
72 circle::BuiltinOptions get_circle_builtin_options_type(const tflite::Operator *op);
75 * @brief Returns circle MirrorPadMode according to tflite.
77 circle::MirrorPadMode get_circle_mirrorpad_mode(tflite::MirrorPadMode tfl_mode);
80 * @brief Returns circle DimensionType according to tflite.
82 circle::DimensionType get_circle_dimension_type(tflite::DimensionType tfl_dim_type);
85 * @brief Returns circle SparseIndexVector according to tflite.
87 flatbuffers::Offset<void>
88 get_circle_sparse_index_vector(flatbuffers::FlatBufferBuilder &fb,
89 const tflite::DimensionMetadata *dm,
90 const tflite::SparseIndexVector &tfl_sparse_index_vector_type);
93 * @brief Returns circle SparseIndexVector type according to tflite.
95 circle::SparseIndexVector
96 get_circle_sparse_index_vector_type(const tflite::SparseIndexVector &tfl_sparse_index_vector_type);
98 } // namespace tflite2circle
100 #endif // __DATA_LOOKUP_H__