2 * Copyright (c) 2022 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 __MPQSOLVER_BISECTION_QUANTIZER_H__
18 #define __MPQSOLVER_BISECTION_QUANTIZER_H__
20 #include <luci/IR/Module.h>
21 #include <luci/CircleQuantizer.h>
32 using LayerParam = luci::CircleQuantizer::Options::LayerParam;
33 using LayerParams = std::vector<std::shared_ptr<LayerParam>>;
38 Quantizer(const std::string &input_dtype, const std::string &output_type);
41 * @brief quantize recorded module (min/max initialized) with specified parameters
42 * returns true on success
44 bool quantize(luci::Module *module, const std::string &quant_dtype, LayerParams &layer_params);
47 * @brief fake_quantize recorded module (min/max initialized) with specified parameters
48 * returns true on success
50 bool fake_quantize(luci::Module *module, const std::string &quant_dtype,
51 LayerParams &layer_params);
54 std::string _input_dtype = "uint8";
55 std::string _output_dtype = "uint8";
58 } // namespace bisection
59 } // namespace mpqsolver
61 #endif //__MPQSOLVER_BISECTION_QUANTIZER_H__