2 * Copyright (c) 2018 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.
21 tflite::Padding as_tflite_padding(const tflchef::Padding &value)
26 return tflite::Padding_SAME;
28 return tflite::Padding_VALID;
33 throw std::runtime_error{"Unknown padding value"};
36 tflite::ActivationFunctionType as_tflite_activation(const tflchef::Activation &value)
41 return tflite::ActivationFunctionType_NONE;
43 return tflite::ActivationFunctionType_RELU;
44 case tflchef::RELU_N1_TO_1:
45 return tflite::ActivationFunctionType_RELU_N1_TO_1;
47 return tflite::ActivationFunctionType_RELU6;
52 throw std::runtime_error{"Unknown activation"};
55 tflite::TensorType as_tflite_tensortype(const tflchef::TensorType &value)
59 case tflchef::FLOAT32:
60 return tflite::TensorType_FLOAT32;
62 return tflite::TensorType_INT32;
64 return tflite::TensorType_UINT8;
66 return tflite::TensorType_INT64;
68 return tflite::TensorType_BOOL;
73 throw std::runtime_error{"Unknown tensor type"};
76 tflite::MirrorPadMode as_tflite_mirrorpadmode(const tflchef::MirrorPadMode &value)
80 case tflchef::REFLECT:
81 return tflite::MirrorPadMode_REFLECT;
82 case tflchef::SYMMETRIC:
83 return tflite::MirrorPadMode_SYMMETRIC;
88 throw std::runtime_error{"Unknown mirrorpad mode"};