2 * Copyright (c) 2023 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 __ONERT_ODC_QUANTIZE_MANAGER_H__
18 #define __ONERT_ODC_QUANTIZE_MANAGER_H__
20 #include "IQuantizer.h"
36 QuantizeManager() = delete;
37 QuantizeManager(const std::string &model_path) : _model_path(model_path) {}
38 QuantizeManager(QuantizeManager const &) = delete;
39 QuantizeManager &operator=(QuantizeManager const &) = delete;
43 * @brief Set model path to export quantized model
45 * @param model_path Model path to export quantized model
47 void exportModelPath(const std::string &model_path) { _export_model_path = model_path; }
50 * @brief Get model path to export quantized model
52 * @return Model path to export quantized model
54 std::string &exportModelPath() { return _export_model_path; }
57 * @brief Set quantize type
59 * @param is_q16 true if q16, false if q8
61 * @todo Support more general quantize type
63 void quantizeType(bool is_q16) { _is_q16 = is_q16; }
66 * @brief Quantize model
68 * @return true if success, otherwise false
73 std::string _model_path = "";
74 std::string _export_model_path = "";
81 #endif // __ONERT_ODC_QUANTIZE_MANAGER_H__