1 /** 2 * Copyright 2021 Huawei Technologies Co., Ltd 3 * 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 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 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. 15 */ 16 #ifndef MINDSPORE_LITE_TOOLS_CONVERTER_CONFIG_PARSER_MICRO_PARAM_PARSER_H_ 17 #define MINDSPORE_LITE_TOOLS_CONVERTER_CONFIG_PARSER_MICRO_PARAM_PARSER_H_ 18 19 #include <string> 20 #include <vector> 21 #include <map> 22 #include "tools/converter/config_parser/config_file_parser.h" 23 #include "tools/converter/micro/coder/config.h" 24 #include "include/errorcode.h" 25 26 namespace mindspore { 27 namespace lite { 28 class MicroParamParser { 29 public: 30 STATUS ParseMicroParam(const MicroParamString µ_param_string, micro::MicroParam *micro_param); 31 32 private: 33 STATUS ParseEnableMicro(const std::string &enable_micro, micro::MicroParam *micro_param); 34 STATUS ParseTarget(const std::string &target, micro::MicroParam *micro_param); 35 STATUS ParseCodeGenMode(const std::string &codegen_mode, micro::MicroParam *micro_param); 36 STATUS ParseSupportParallel(const std::string &support_parallel, micro::MicroParam *micro_param); 37 STATUS ParseDebugMode(const std::string &debug_mode, micro::MicroParam *micro_param); 38 STATUS ParseSavePath(const std::string &debug_mode, micro::MicroParam *micro_param); 39 STATUS ParseProjName(const std::string &debug_mode, micro::MicroParam *micro_param); 40 STATUS ParseKeepOriginalWeight(const std::string &keep_weight, micro::MicroParam *micro_param); 41 STATUS ParseChangeableWeightsName(const std::string &changeable_weights_name, micro::MicroParam *micro_param); 42 STATUS ParseGraphInputsShapeTemplate(const std::string &graph_inputs_shape_template, 43 const std::map<std::string, std::vector<int>> &dynamic_symbols_map, 44 micro::MicroParam *micro_param); 45 }; 46 } // namespace lite 47 } // namespace mindspore 48 49 #endif // MINDSPORE_LITE_TOOLS_CONVERTER_CONFIG_PARSER_MICRO_PARAM_PARSER_H_ 50