/** * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef INC_FRAMEWORK_OMG_PARSER_PARSER_INNER_CONTEXT_H_ #define INC_FRAMEWORK_OMG_PARSER_PARSER_INNER_CONTEXT_H_ #include #include #include #include #include #include "external/register/register_fmk_types.h" #include "external/register/register_types.h" #include "framework/omg/omg_inner_types.h" namespace ge { struct ParserContext { // format of the input specified by the command line std::unordered_map input_nodes_format_map; std::vector output_formats; // user-designate input dims std::vector>> user_input_dims; std::map> input_dims; // resolve the mapping between operators with the same name and corresponding network. format e.g. // Detectionoutput:SsdDetectiontOutput std::map op_conf_map; // user-designate out nodes (this is used for determing the orders) std::vector> user_out_nodes; // default out nodes (this is used for determing the orders) std::vector> default_out_nodes; // save the output node of the network. key = operator name, value = index, index indicates the output index of the // operator std::map> out_nodes_map; // save the output node of the network, value = topName, // tensorName indicates the output name of the operator. std::vector user_out_tensors; // net out nodes (where user_out_nodes or leaf nodes) std::vector net_out_nodes; // net out nodes tensor names(caffe or onnx) std::vector out_tensor_names; // net data nodes tensor names(caffe or onnx) std::vector data_tensor_names; // Whether to use dynamic batch size or dynamic image size bool is_dynamic_input = false; bool train_flag = false; domi::domiTensorFormat_t format = domi::DOMI_TENSOR_ND; domi::FrameworkType type = domi::FRAMEWORK_RESERVED; RunMode run_mode = GEN_OM_MODEL; // save caffe custom proto path, used by caffe parse std::string custom_proto_path; // save caffe proto path, used by caffe parse std::string caffe_proto_path; // name of the pass that needs to take effect std::string enable_scope_fusion_passes; }; GE_FUNC_VISIBILITY ParserContext &GetParserContext(); } // namespace ge #endif // INC_FRAMEWORK_OMG_PARSER_PARSER_INNER_CONTEXT_H_