diff --git a/parser/caffe/caffe_custom_parser_adapter.cc b/parser/caffe/caffe_custom_parser_adapter.cc index d250f38..4cfd084 100644 --- a/parser/caffe/caffe_custom_parser_adapter.cc +++ b/parser/caffe/caffe_custom_parser_adapter.cc @@ -17,7 +17,6 @@ #include "parser/caffe/caffe_custom_parser_adapter.h" #include #include -#include "common/debug/log.h" #include "parser/common/acl_graph_parser_util.h" #include "common/util.h" #include "framework/common/debug/ge_log.h" diff --git a/parser/caffe/caffe_data_parser.cc b/parser/caffe/caffe_data_parser.cc index 1611126..f7acb63 100644 --- a/parser/caffe/caffe_data_parser.cc +++ b/parser/caffe/caffe_data_parser.cc @@ -17,7 +17,6 @@ #include "parser/caffe/caffe_data_parser.h" #include #include -#include "common/debug/log.h" #include "framework/omg/parser/parser_types.h" #include "common/util.h" #include "common/util/error_manager/error_manager.h" diff --git a/parser/caffe/caffe_parser.cc b/parser/caffe/caffe_parser.cc index 18c1727..cabf948 100644 --- a/parser/caffe/caffe_parser.cc +++ b/parser/caffe/caffe_parser.cc @@ -22,17 +22,14 @@ #include #include #include "parser/common/convert/pb2json.h" -#include "common/debug/log.h" #include "parser/common/acl_graph_parser_util.h" #include "common/op_map.h" #include "common/util/error_manager/error_manager.h" -#include "common/ge_types.h" #include "common/string_util.h" #include "external/graph/operator_factory.h" #include "external/parser/caffe_parser.h" #include "external/ge/ge_api_types.h" #include "framework/common/debug/ge_log.h" -#include "graph/optimize/common/params.h" #include "graph/utils/graph_utils.h" #include #include @@ -52,6 +49,7 @@ #include "parser/common/acl_graph_parser_util.h" #include "parser/common/proto_file_parser.h" #include "register/op_registry.h" +#include "register/register_fmk_types.h" using domi::caffe::LayerParameter; using domi::caffe::NetParameter; @@ -79,7 +77,7 @@ graphStatus aclgrphParseCaffe(const char *model_file, const char *weights_file, GE_CHECK_NOTNULL(model_file); GetParserContext().type = domi::CAFFE; std::map options; - options.insert(std::pair(string(ge::FRAMEWORK_TYPE), to_string(ge::CAFFE))); + options.insert(std::pair(string(ge::FRAMEWORK_TYPE), to_string(domi::CAFFE))); // load custom plugin so and proto AclGrphParseUtil acl_graph_parse_util; @@ -126,7 +124,7 @@ graphStatus aclgrphParseCaffe(const char *model_file, const char *weights_file, GE_CHECK_NOTNULL(model_file); GetParserContext().type = domi::CAFFE; std::map options; - options.insert(std::pair(string(ge::FRAMEWORK_TYPE), to_string(ge::CAFFE))); + options.insert(std::pair(string(ge::FRAMEWORK_TYPE), to_string(domi::CAFFE))); // load custom plugin so and proto AclGrphParseUtil acl_graph_parse_util; diff --git a/parser/caffe/caffe_reshape_parser.cc b/parser/caffe/caffe_reshape_parser.cc index 2edabbf..9366827 100644 --- a/parser/caffe/caffe_reshape_parser.cc +++ b/parser/caffe/caffe_reshape_parser.cc @@ -16,9 +16,7 @@ #include "parser/caffe/caffe_reshape_parser.h" #include -#include "common/debug/log.h" #include "parser/common/acl_graph_parser_util.h" -#include "common/op/op_parser_util.h" #include "common/util.h" #include "framework/common/debug/ge_log.h" #include "graph/utils/graph_utils.h" @@ -33,6 +31,8 @@ namespace ge { namespace { const int kAnchorIndexZero = 0; const int kAnchorIndexOne = 1; +const int32_t RESHAPE_AXIS_DEFAULT_VALUE = 0; +const int32_t RESHAPE_NUM_AXES_DEFAULT_VALUE = -1; } // namespace Status CaffeReshapeParser::ParseParams(const Message *op_src, ge::OpDescPtr &op) { diff --git a/parser/common/acl_graph_parser_util.cc b/parser/common/acl_graph_parser_util.cc index e52b792..181b3e7 100644 --- a/parser/common/acl_graph_parser_util.cc +++ b/parser/common/acl_graph_parser_util.cc @@ -23,7 +23,6 @@ #include #include -#include "common/debug/log.h" #include "common/op/ge_op_utils.h" #include "common/string_util.h" #include "common/types.h" diff --git a/parser/common/data_op_parser.cc b/parser/common/data_op_parser.cc index f6bb9e9..009fe72 100644 --- a/parser/common/data_op_parser.cc +++ b/parser/common/data_op_parser.cc @@ -16,12 +16,11 @@ #include "parser/common/data_op_parser.h" #include -#include "common/debug/log.h" #include "common/op/ge_op_utils.h" #include "parser/common/acl_graph_parser_util.h" +#include "omg/parser/parser_inner_ctx.h" #include "common/util.h" #include "graph/utils/type_utils.h" -#include "omg/omg.h" namespace { const int kDataMemAlignSize = 32; diff --git a/parser/common/data_op_parser.h b/parser/common/data_op_parser.h index 53bab18..8e1cd30 100644 --- a/parser/common/data_op_parser.h +++ b/parser/common/data_op_parser.h @@ -19,11 +19,11 @@ #include #include -#include "common/debug/log.h" #include "common/op/attr_value_util.h" #include "framework/omg/parser/parser_types.h" #include "omg/omg_inner_types.h" #include "proto/om.pb.h" +#include "ge/ge_api_error_codes.h" #include "graph/attr_value.h" #include "graph/compute_graph.h" diff --git a/parser/common/model_saver.cc b/parser/common/model_saver.cc index 6f18029..3bceeb9 100644 --- a/parser/common/model_saver.cc +++ b/parser/common/model_saver.cc @@ -19,7 +19,7 @@ #include "parser/common/model_saver.h" #include "framework/common/debug/ge_log.h" -#include "framework/common/debug/log.h" +#include "common/util.h" #include "common/util/error_manager/error_manager.h" #include "mmpa/mmpa_api.h" diff --git a/parser/common/op_def/ir_pb_converter.cc b/parser/common/op_def/ir_pb_converter.cc index 8b5a8d4..432a0d1 100644 --- a/parser/common/op_def/ir_pb_converter.cc +++ b/parser/common/op_def/ir_pb_converter.cc @@ -24,7 +24,7 @@ #include "graph/buffer.h" #include "framework/common/debug/ge_log.h" #include "framework/omg/parser/parser_types.h" -#include "framework/common/util.h" +#include "common/util.h" namespace ge { static void ConvertList(const std::pair &op_attr_pair, ge::OpDescPtr op_def) { diff --git a/parser/common/op_def/op_schema.cc b/parser/common/op_def/op_schema.cc index 5882b44..a6422ca 100644 --- a/parser/common/op_def/op_schema.cc +++ b/parser/common/op_def/op_schema.cc @@ -18,7 +18,6 @@ #include #include #include "framework/common/debug/ge_log.h" -#include "framework/common/debug/log.h" namespace ge { OpSchema::FormalParameter::FormalParameter(const std::string &name, FormalParameterOption param_option) diff --git a/parser/common/op_def/operator.cc b/parser/common/op_def/operator.cc index d18175d..f7b5081 100644 --- a/parser/common/op_def/operator.cc +++ b/parser/common/op_def/operator.cc @@ -17,7 +17,7 @@ #include "operator.h" #include #include "framework/common/fmk_types.h" -#include "framework/common/util.h" +#include "common/util.h" #include "framework/common/debug/ge_log.h" using ge::BoolTuple; diff --git a/parser/common/op_parser_factory.cc b/parser/common/op_parser_factory.cc index 23d95d7..1fbebbf 100644 --- a/parser/common/op_parser_factory.cc +++ b/parser/common/op_parser_factory.cc @@ -15,7 +15,6 @@ */ #include "parser/common/op_parser_factory.h" -#include "common/debug/log.h" #include "framework/common/debug/ge_log.h" #include "graph/utils/type_utils.h" diff --git a/parser/common/parser_api.cc b/parser/common/parser_api.cc index baa8c98..2110116 100644 --- a/parser/common/parser_api.cc +++ b/parser/common/parser_api.cc @@ -15,8 +15,8 @@ */ #include "framework/omg/parser/parser_api.h" -#include "common/debug/log.h" +#include "common/util.h" #include "tbe_plugin_loader.h" #include "framework/common/debug/ge_log.h" #include "parser/common/register_tbe.h" diff --git a/parser/common/parser_factory.cc b/parser/common/parser_factory.cc index ce85d3c..0ba2736 100644 --- a/parser/common/parser_factory.cc +++ b/parser/common/parser_factory.cc @@ -15,7 +15,6 @@ */ #include "omg/parser/parser_factory.h" -#include "common/debug/log.h" #include "framework/common/debug/ge_log.h" namespace domi { diff --git a/parser/common/parser_utils.cc b/parser/common/parser_utils.cc index 5de81a3..91c2a64 100644 --- a/parser/common/parser_utils.cc +++ b/parser/common/parser_utils.cc @@ -17,7 +17,7 @@ #include "parser_utils.h" #include "external/ge/ge_api_types.h" #include "framework/common/debug/ge_log.h" -#include "framework/common/util.h" +#include "common/util.h" #include "framework/omg/parser/parser_types.h" #include "graph/anchor.h" #include "graph/compute_graph.h" diff --git a/parser/common/pass_manager.cc b/parser/common/pass_manager.cc index 0c28572..2f44e49 100644 --- a/parser/common/pass_manager.cc +++ b/parser/common/pass_manager.cc @@ -17,7 +17,6 @@ #include "parser/common/pass_manager.h" #include "framework/omg/parser/parser_types.h" #include "parser/common/acl_graph_parser_util.h" -#include "common/debug/log.h" #include "graph/utils/node_utils.h" #include "omg/omg_inner_types.h" diff --git a/parser/common/pre_checker.cc b/parser/common/pre_checker.cc index 91ea192..96a6345 100644 --- a/parser/common/pre_checker.cc +++ b/parser/common/pre_checker.cc @@ -21,9 +21,9 @@ #include "common/util.h" #include "common/util/error_manager/error_manager.h" #include "framework/common/debug/ge_log.h" -#include "omg/omg.h" #include "parser/common/op_parser_factory.h" #include "parser/common/model_saver.h" +#include "omg/parser/parser_inner_ctx.h" #include "register/op_registry.h" namespace ge { diff --git a/parser/common/proto_file_parser.cc b/parser/common/proto_file_parser.cc index 731ac8c..80741da 100644 --- a/parser/common/proto_file_parser.cc +++ b/parser/common/proto_file_parser.cc @@ -26,7 +26,6 @@ #include "common/string_util.h" #include "common/types.h" #include "common/util.h" -#include "common/debug/log.h" #include "parser/common/acl_graph_parser_util.h" #include "ge/ge_api_types.h" #include "framework/common/debug/ge_log.h" diff --git a/parser/common/register_tbe.cc b/parser/common/register_tbe.cc index c8943bb..0e21c59 100644 --- a/parser/common/register_tbe.cc +++ b/parser/common/register_tbe.cc @@ -18,7 +18,6 @@ #include #include #include -#include "common/debug/log.h" #include "parser/common/acl_graph_parser_util.h" #include "common/op/ge_op_utils.h" #include "common/op_map.h" diff --git a/parser/common/tuple.h b/parser/common/tuple.h index 425f215..e038ab2 100644 --- a/parser/common/tuple.h +++ b/parser/common/tuple.h @@ -23,7 +23,7 @@ #include #include #include -#include "framework/common/debug/log.h" +#include "framework/common/debug/ge_log.h" namespace ge { template diff --git a/parser/common/util.h b/parser/common/util.h new file mode 100644 index 0000000..1becd68 --- /dev/null +++ b/parser/common/util.h @@ -0,0 +1,248 @@ +/** + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * + * 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 PARSER_COMMON_UTIL_H_ +#define PARSER_COMMON_UTIL_H_ + +#include "framework/common/debug/ge_log.h" +#include "mmpa/mmpa_api.h" + +#define CHECK_FALSE_EXEC(expr, exec_expr, ...) \ + { \ + bool b = (expr); \ + if (!b) { \ + exec_expr; \ + } \ + } + +// For propagating errors when calling a function. +#define GE_RETURN_IF_ERROR(expr) \ + do { \ + const ::ge::Status _status = (expr); \ + if (_status) return _status; \ + } while (0) + +#define GE_RETURN_WITH_LOG_IF_ERROR(expr, ...) \ + do { \ + const ::ge::Status _status = (expr); \ + if (_status) { \ + GELOGE(ge::FAILED, __VA_ARGS__); \ + return _status; \ + } \ + } while (0) + +// check whether the parameter is true. If it is, return FAILED and record the error log +#define GE_RETURN_WITH_LOG_IF_TRUE(condition, ...) \ + do { \ + if (condition) { \ + GELOGE(ge::FAILED, __VA_ARGS__); \ + return ge::FAILED; \ + } \ + } while (0) + +// Check if the parameter is false. If yes, return FAILED and record the error log +#define GE_RETURN_WITH_LOG_IF_FALSE(condition, ...) \ + do { \ + bool _condition = (condition); \ + if (!_condition) { \ + GELOGE(ge::FAILED, __VA_ARGS__); \ + return ge::FAILED; \ + } \ + } while (0) + +// Check if the parameter is false. If yes, return PARAM_INVALID and record the error log +#define GE_RT_PARAM_INVALID_WITH_LOG_IF_FALSE(condition, ...) \ + do { \ + bool _condition = (condition); \ + if (!_condition) { \ + GELOGE(ge::FAILED, __VA_ARGS__); \ + return ge::PARAM_INVALID; \ + } \ + } while (0) + +// Check if the parameter is null. If yes, return PARAM_INVALID and record the error +#define GE_CHECK_NOTNULL(val) \ + do { \ + if (val == nullptr) { \ + GELOGE(ge::FAILED, "param[%s] must not be null.", #val); \ + return ge::PARAM_INVALID; \ + } \ + } while (0) + +// Check whether the parameter is null. If so, execute the exec_expr expression and record the error log +#define GE_CHECK_NOTNULL_EXEC(val, exec_expr) \ + do { \ + if (val == nullptr) { \ + GELOGE(ge::FAILED, "param[%s] must not be null.", #val); \ + exec_expr; \ + } \ + } while (0) + +// Check if the value on the left is greater than or equal to the value on the right +#define GE_CHECK_GE(lhs, rhs) \ + do { \ + if (lhs < rhs) { \ + GELOGE(ge::FAILED, "param[%s] is less than[%s]", #lhs, #rhs); \ + return ge::PARAM_INVALID; \ + } \ + } while (0) + +#define GE_DELETE_NEW_SINGLE(var) \ + do { \ + if (var != nullptr) { \ + delete var; \ + var = nullptr; \ + } \ + } while (0) + +#define GE_DELETE_NEW_ARRAY(var) \ + do { \ + if (var != nullptr) { \ + delete[] var; \ + var = nullptr; \ + } \ + } while (0) + +// If expr is true, execute exec_expr without printing logs +#define GE_IF_BOOL_EXEC(expr, exec_expr) \ + { \ + if (expr) { \ + exec_expr; \ + } \ + } + +// If expr is not true, print the log and execute a custom statement +#define GE_CHK_BOOL_TRUE_EXEC_INFO(expr, exec_expr, ...) \ + { \ + bool b = (expr); \ + if (b) { \ + GELOGI(__VA_ARGS__); \ + exec_expr; \ + } \ + } + +// If expr is not true, print the log and return the specified status +#define GE_CHK_BOOL_RET_STATUS(expr, _status, ...) \ + do { \ + bool b = (expr); \ + if (!b) { \ + GELOGE(_status, __VA_ARGS__); \ + return _status; \ + } \ + } while (0); + +// If expr is not SUCCESS, print the log and execute the expression + return _status +#define GE_CHK_BOOL_TRUE_EXEC_RET_STATUS(expr, _status, exec_expr, ...) \ + { \ + bool b = (expr); \ + if (b) { \ + GELOGE(ge::FAILED, __VA_ARGS__); \ + exec_expr; \ + return _status; \ + } \ + } + +// If expr is not SUCCESS, print the log and return the same value +#define GE_CHK_STATUS_RET(expr, ...) \ + do { \ + const ge::Status _status = (expr); \ + if (_status != ge::SUCCESS) { \ + GELOGE(ge::FAILED, __VA_ARGS__); \ + return _status; \ + } \ + } while (0); + +// If expr is true, print logs and execute custom statements +#define GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(expr, exec_expr, ...) \ + { \ + bool b = (expr); \ + if (b) { \ + GELOGE(ge::FAILED, __VA_ARGS__); \ + exec_expr; \ + } \ + } + +// If expr is not SUCCESS, print the log and do not execute return +#define GE_CHK_STATUS(expr, ...) \ + do { \ + const ge::Status _status = (expr); \ + if (_status != ge::SUCCESS) { \ + GELOGE(ge::FAILED, __VA_ARGS__); \ + } \ + } while (0); + +#define GE_LOGE_IF(condition, ...) \ + if ((condition)) { \ + GELOGE(ge::FAILED, __VA_ARGS__); \ + } + +// If expr is not true, print the log and execute a custom statement +#define GE_CHK_BOOL_EXEC(expr, exec_expr, ...) \ + { \ + bool b = (expr); \ + if (!b) { \ + GELOGE(ge::FAILED, __VA_ARGS__); \ + exec_expr; \ + } \ + } + +// ge marco +#define GE_LOGI_IF(condition, ...) \ + if ((condition)) { \ + GELOGI(__VA_ARGS__); \ + } + +#define GE_LOGW_IF(condition, ...) \ + if ((condition)) { \ + GELOGW(__VA_ARGS__); \ + } + +// If expr is not true, execute a custom statement +#define GE_CHK_BOOL_EXEC_NOLOG(expr, exec_expr) \ + { \ + bool b = (expr); \ + if (!b) { \ + exec_expr; \ + } \ + } + +// If expr is not SUCCESS, print the log and execute a custom statement +#define GE_CHK_STATUS_EXEC(expr, exec_expr, ...) \ + do { \ + const ge::Status _status = (expr); \ + GE_CHK_BOOL_EXEC(_status == SUCCESS, exec_expr, __VA_ARGS__); \ + } while (0); + +// If expr is not true, print the log and execute a custom statement +#define GE_CHK_BOOL_EXEC_INFO(expr, exec_expr, ...) \ + { \ + bool b = (expr); \ + if (!b) { \ + GELOGI(__VA_ARGS__); \ + exec_expr; \ + } \ + } + +// If make_shared is abnormal, print the log and execute the statement +#define GE_MAKE_SHARED(exec_expr0, exec_expr1) \ + try { \ + exec_expr0; \ + } catch (const std::bad_alloc &) { \ + GELOGE(ge::FAILED, "Make shared failed"); \ + exec_expr1; \ + } + +#endif // PARSER_COMMON_UTIL_H_ diff --git a/parser/onnx/onnx_constant_parser.cc b/parser/onnx/onnx_constant_parser.cc index 479e52f..f373a50 100644 --- a/parser/onnx/onnx_constant_parser.cc +++ b/parser/onnx/onnx_constant_parser.cc @@ -18,7 +18,7 @@ #include #include #include "parser/common/acl_graph_parser_util.h" -#include "common/util.h" + #include "framework/omg/parser/parser_inner_ctx.h" #include "graph/ge_tensor.h" #include "graph/utils/tensor_adapter.h" diff --git a/parser/onnx/onnx_constant_parser.h b/parser/onnx/onnx_constant_parser.h index 5df6564..571fae2 100644 --- a/parser/onnx/onnx_constant_parser.h +++ b/parser/onnx/onnx_constant_parser.h @@ -18,6 +18,7 @@ #define GE_PARSER_ONNX_ONNX_CONSTANT_PARSER_H_ #include +#include "common/util.h" #include "parser/common/data_op_parser.h" #include "parser/onnx/onnx_op_parser.h" diff --git a/parser/onnx/onnx_parser.cc b/parser/onnx/onnx_parser.cc index d6dfcdb..899626f 100644 --- a/parser/onnx/onnx_parser.cc +++ b/parser/onnx/onnx_parser.cc @@ -19,7 +19,6 @@ #include #include "common/convert/pb2json.h" #include "common/util.h" -#include "common/ge_types.h" #include "common/util/error_manager/error_manager.h" #include "external/graph/operator_factory.h" #include "external/register/register_error_codes.h" @@ -37,6 +36,7 @@ #include "parser/common/parser_utils.h" #include "parser/onnx/onnx_util.h" #include "register/op_registry.h" +#include "register/register_fmk_types.h" namespace ge { graphStatus PrepareBeforeParse(AclGrphParseUtil &acl_graph_parse_util, @@ -44,7 +44,7 @@ graphStatus PrepareBeforeParse(AclGrphParseUtil &acl_graph_parse_util, ge::Graph &graph, std::shared_ptr &model_parser) { GetParserContext().type = domi::ONNX; std::map options; - options.insert(std::pair(string(ge::FRAMEWORK_TYPE), to_string(ge::ONNX))); + options.insert(std::pair(string(ge::FRAMEWORK_TYPE), to_string(domi::ONNX))); if (acl_graph_parse_util.AclParserInitialize(options) != ge::SUCCESS) { GELOGE(ge::FAILED, "Acl parser initialize failed."); diff --git a/parser/tensorflow/graph_optimizer.cc b/parser/tensorflow/graph_optimizer.cc index 9e2f875..706901d 100644 --- a/parser/tensorflow/graph_optimizer.cc +++ b/parser/tensorflow/graph_optimizer.cc @@ -22,15 +22,14 @@ #include "./graph_insert_trans_op.h" #include "cce/cce.h" #include "cce/dnn.h" -#include "common/debug/log.h" #include "parser/common/acl_graph_parser_util.h" #include "common/op/ge_op_utils.h" #include "common/op_map.h" +#include "common/op_types.h" #include "common/types_map.h" #include "framework/common/debug/ge_log.h" #include "framework/omg/parser/parser_inner_ctx.h" #include "framework/omg/parser/parser_types.h" -#include "graph/common/omg_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/ge_tensor.h" #include "graph/types.h" diff --git a/parser/tensorflow/iterator_fusion_pass.cc b/parser/tensorflow/iterator_fusion_pass.cc index 0324050..2aede1e 100644 --- a/parser/tensorflow/iterator_fusion_pass.cc +++ b/parser/tensorflow/iterator_fusion_pass.cc @@ -18,7 +18,6 @@ #include -#include "common/debug/log.h" #include "framework/omg/parser/parser_types.h" #include "common/util.h" #include "graph_optimizer.h" diff --git a/parser/tensorflow/iterator_fusion_pass.h b/parser/tensorflow/iterator_fusion_pass.h index c193acf..a9dd3df 100644 --- a/parser/tensorflow/iterator_fusion_pass.h +++ b/parser/tensorflow/iterator_fusion_pass.h @@ -17,13 +17,13 @@ #ifndef GE_GRAPH_PASSES_ITERATOR_FUSION_PASS_H_ #define GE_GRAPH_PASSES_ITERATOR_FUSION_PASS_H_ -#include "framework/common/ge_types.h" #include "inc/graph_pass.h" +#include "register/register_fmk_types.h" namespace ge { class IteratorFusionPass : public GraphPass { public: - IteratorFusionPass(ge::FrameworkType type, bool local_fmk_op_flag) + IteratorFusionPass(domi::FrameworkType type, bool local_fmk_op_flag) : fmk_type_(type), local_fmk_op_flag_(local_fmk_op_flag) {} virtual ~IteratorFusionPass() {} @@ -31,7 +31,7 @@ class IteratorFusionPass : public GraphPass { Status Run(ge::ComputeGraphPtr graph) final; private: - ge::FrameworkType fmk_type_; + domi::FrameworkType fmk_type_; bool local_fmk_op_flag_; }; } // namespace ge diff --git a/parser/tensorflow/tensorflow_arg_parser.cc b/parser/tensorflow/tensorflow_arg_parser.cc index 35a34c8..dca9921 100644 --- a/parser/tensorflow/tensorflow_arg_parser.cc +++ b/parser/tensorflow/tensorflow_arg_parser.cc @@ -14,7 +14,6 @@ * limitations under the License. */ -#include "common/debug/log.h" #include "parser/common/op_def/arg_op.h" #include "framework/common/debug/ge_log.h" #include "framework/omg/parser/parser_inner_ctx.h" diff --git a/parser/tensorflow/tensorflow_constant_parser.cc b/parser/tensorflow/tensorflow_constant_parser.cc index 4e4244d..c7e534d 100644 --- a/parser/tensorflow/tensorflow_constant_parser.cc +++ b/parser/tensorflow/tensorflow_constant_parser.cc @@ -18,7 +18,6 @@ #include #include #include -#include "common/debug/log.h" #include "parser/common/acl_graph_parser_util.h" #include "common/op/ge_op_utils.h" #include "parser/common/op_def/constant_op.h" diff --git a/parser/tensorflow/tensorflow_data_parser.cc b/parser/tensorflow/tensorflow_data_parser.cc index 378d4d2..3c02c37 100644 --- a/parser/tensorflow/tensorflow_data_parser.cc +++ b/parser/tensorflow/tensorflow_data_parser.cc @@ -16,7 +16,6 @@ #include "parser/tensorflow/tensorflow_data_parser.h" #include -#include "common/debug/log.h" #include "common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/omg/parser/parser_inner_ctx.h" diff --git a/parser/tensorflow/tensorflow_enter_parser.cc b/parser/tensorflow/tensorflow_enter_parser.cc index af065bd..8bccfab 100644 --- a/parser/tensorflow/tensorflow_enter_parser.cc +++ b/parser/tensorflow/tensorflow_enter_parser.cc @@ -16,7 +16,7 @@ #include "parser/tensorflow/tensorflow_enter_parser.h" #include "framework/common/debug/ge_log.h" -#include "framework/common/debug/log.h" +#include "common/util.h" #include "graph/debug/ge_attr_define.h" #include "parser/common/op_parser_factory.h" #include "framework/omg/parser/parser_types.h" diff --git a/parser/tensorflow/tensorflow_fill_parser.cc b/parser/tensorflow/tensorflow_fill_parser.cc index d467ed3..06c83a4 100644 --- a/parser/tensorflow/tensorflow_fill_parser.cc +++ b/parser/tensorflow/tensorflow_fill_parser.cc @@ -15,10 +15,8 @@ */ // Copyright (c) <2018>, -#include "common/debug/log.h" #include "common/op/attr_value_util.h" #include "parser/common/op_def/fill_op.h" -#include "common/util.h" #include "parser/tensorflow/tensorflow_parser_register.h" #include "framework/omg/parser/parser_types.h" diff --git a/parser/tensorflow/tensorflow_frameworkop_parser.cc b/parser/tensorflow/tensorflow_frameworkop_parser.cc index 343c579..603bb56 100644 --- a/parser/tensorflow/tensorflow_frameworkop_parser.cc +++ b/parser/tensorflow/tensorflow_frameworkop_parser.cc @@ -14,7 +14,6 @@ * limitations under the License. */ -#include "common/debug/log.h" #include "parser/common/op_def/frameworkop_op.h" #include "framework/common/debug/ge_log.h" #include "parser/common/op_parser_factory.h" diff --git a/parser/tensorflow/tensorflow_fusion_op_parser.cc b/parser/tensorflow/tensorflow_fusion_op_parser.cc index ee50672..f78371e 100644 --- a/parser/tensorflow/tensorflow_fusion_op_parser.cc +++ b/parser/tensorflow/tensorflow_fusion_op_parser.cc @@ -16,11 +16,9 @@ #include "parser/tensorflow/tensorflow_fusion_op_parser.h" #include -#include "common/debug/log.h" #include "parser/common/acl_graph_parser_util.h" #include "common/util.h" #include "framework/common/debug/ge_log.h" -#include "omg/omg.h" #include "parser/common/parser_fp16_t.h" #include "parser/tensorflow/tensorflow_op_parser.h" #include "register/tensor_assign.h" diff --git a/parser/tensorflow/tensorflow_fusionop_util.cc b/parser/tensorflow/tensorflow_fusionop_util.cc index 404f7e4..d6f8617 100644 --- a/parser/tensorflow/tensorflow_fusionop_util.cc +++ b/parser/tensorflow/tensorflow_fusionop_util.cc @@ -16,7 +16,6 @@ #include "parser/tensorflow/tensorflow_fusionop_util.h" #include "common/util/error_manager/error_manager.h" -#include "common/debug/log.h" #include "common/op/ge_op_utils.h" #include "framework/common/debug/ge_log.h" #include "parser/tensorflow/tensorflow_parser.h" diff --git a/parser/tensorflow/tensorflow_fusionop_util.h b/parser/tensorflow/tensorflow_fusionop_util.h index f08ccf9..4588d9f 100644 --- a/parser/tensorflow/tensorflow_fusionop_util.h +++ b/parser/tensorflow/tensorflow_fusionop_util.h @@ -20,10 +20,8 @@ #include #include #include -#include "common/debug/log.h" #include "common/string_util.h" #include "framework/omg/parser/parser_types.h" -#include "common/util.h" #include "omg/omg_inner_types.h" #include "proto/tensorflow/graph.pb.h" #include "external/register/scope/scope_fusion_pass_register.h" diff --git a/parser/tensorflow/tensorflow_merge_parser.cc b/parser/tensorflow/tensorflow_merge_parser.cc index 6f1dedb..3557901 100644 --- a/parser/tensorflow/tensorflow_merge_parser.cc +++ b/parser/tensorflow/tensorflow_merge_parser.cc @@ -17,7 +17,7 @@ #include "parser/tensorflow/tensorflow_merge_parser.h" #include "framework/common/debug/ge_log.h" -#include "framework/common/util.h" +#include "common/util.h" #include "graph/debug/ge_attr_define.h" #include "parser/common/op_parser_factory.h" #include "framework/omg/parser/parser_types.h" diff --git a/parser/tensorflow/tensorflow_no_op_parser.cc b/parser/tensorflow/tensorflow_no_op_parser.cc index 633e921..749f16e 100644 --- a/parser/tensorflow/tensorflow_no_op_parser.cc +++ b/parser/tensorflow/tensorflow_no_op_parser.cc @@ -15,7 +15,7 @@ */ #include "parser/tensorflow/tensorflow_no_op_parser.h" -#include "framework/common/util.h" +#include "common/util.h" #include "framework/common/debug/ge_log.h" #include "parser/common/op_def/ir_pb_converter.h" #include "parser/common/op_def/no_op_op.h" diff --git a/parser/tensorflow/tensorflow_parser.cc b/parser/tensorflow/tensorflow_parser.cc index 94a638d..d8a9d1d 100644 --- a/parser/tensorflow/tensorflow_parser.cc +++ b/parser/tensorflow/tensorflow_parser.cc @@ -17,8 +17,8 @@ #include "parser/tensorflow/tensorflow_parser.h" #include #include +#include "ge/ge_api_types.h" #include "parser/common/convert/pb2json.h" -#include "common/debug/log.h" #include "parser/common/acl_graph_parser_util.h" #include "common/util/error_manager/error_manager.h" #include "external/graph/operator_factory.h" @@ -28,13 +28,10 @@ #include "framework/omg/parser/parser_api.h" #include "framework/omg/parser/parser_inner_ctx.h" #include "graph/debug/ge_attr_define.h" -#include "graph/optimize/common/params.h" -#include "graph/passes/variable_format_pass.h" #include "graph/utils/graph_utils.h" #include "graph/utils/node_utils.h" #include "graph/utils/type_utils.h" #include "iterator_fusion_pass.h" -#include "omg/omg.h" #include "omg/parser/op_parser.h" #include "omg/parser/parser_factory.h" #include "parser/common/acl_graph_parser_util.h" @@ -93,7 +90,7 @@ graphStatus aclgrphParseTensorFlow(const char *model_file, ge::Graph &graph) { GE_CHECK_NOTNULL(model_file); GetParserContext().type = domi::TENSORFLOW; std::map options; - options.insert(std::pair(string(ge::FRAMEWORK_TYPE), to_string(ge::TENSORFLOW))); + options.insert(std::pair(string(ge::FRAMEWORK_TYPE), to_string(domi::TENSORFLOW))); // load custom plugin so and proto AclGrphParseUtil acl_graph_parse_util; @@ -132,7 +129,7 @@ graphStatus aclgrphParseTensorFlow(const char *model_file, const std::map options; - options.insert(std::pair(string(ge::FRAMEWORK_TYPE), to_string(ge::TENSORFLOW))); + options.insert(std::pair(string(ge::FRAMEWORK_TYPE), to_string(domi::TENSORFLOW))); // load custom plugin so and proto AclGrphParseUtil acl_graph_parse_util; @@ -2244,7 +2241,7 @@ Status TensorFlowModelParser::ParseProto(const google::protobuf::Message *proto, ge::parser::PassManager iterator_fusion_pass; try { (void)iterator_fusion_pass.AddPass("ParseProto::IteratorFusionPass", - new ge::IteratorFusionPass(ge::TENSORFLOW, false)); + new ge::IteratorFusionPass(domi::TENSORFLOW, false)); } catch (std::bad_alloc &e) { GELOGE(INTERNAL_ERROR, "Add pass failed, bad memory allocation occurs."); return INTERNAL_ERROR; diff --git a/parser/tensorflow/tensorflow_parser_register.h b/parser/tensorflow/tensorflow_parser_register.h index 4abbd00..bbe1ca1 100644 --- a/parser/tensorflow/tensorflow_parser_register.h +++ b/parser/tensorflow/tensorflow_parser_register.h @@ -21,7 +21,7 @@ #include #include #include -#include "framework/common/util.h" +#include "common/util.h" #include "framework/omg/parser/op_parser.h" #include "parser/common/op_def/ir_pb_converter.h" #include "parser/common/op_def/operator.h" diff --git a/parser/tensorflow/tensorflow_reshape_parser.cc b/parser/tensorflow/tensorflow_reshape_parser.cc index ceed5ac..2157e23 100644 --- a/parser/tensorflow/tensorflow_reshape_parser.cc +++ b/parser/tensorflow/tensorflow_reshape_parser.cc @@ -16,13 +16,12 @@ #include "parser/tensorflow/tensorflow_reshape_parser.h" #include "framework/common/debug/ge_log.h" -#include "framework/common/debug/log.h" #include "framework/common/op/ge_op_utils.h" -#include "framework/omg/omg.h" #include "graph/utils/type_utils.h" #include "parser/common/op_parser_factory.h" #include "parser/tensorflow/tensorflow_util.h" #include "parser/common/acl_graph_parser_util.h" +#include "omg/parser/parser_inner_ctx.h" using domi::TENSORFLOW; using namespace ge::parser; diff --git a/parser/tensorflow/tensorflow_squeeze_parser.cc b/parser/tensorflow/tensorflow_squeeze_parser.cc index 25f8700..309d393 100644 --- a/parser/tensorflow/tensorflow_squeeze_parser.cc +++ b/parser/tensorflow/tensorflow_squeeze_parser.cc @@ -18,10 +18,8 @@ #include #include #include "framework/common/debug/ge_log.h" -#include "framework/common/debug/log.h" #include "framework/common/op/attr_value_util.h" -#include "framework/common/op/op_parser_util.h" -#include "framework/common/util.h" +#include "common/util.h" #include "framework/omg/parser/parser_inner_ctx.h" #include "graph/utils/type_utils.h" #include "parser/common/op_parser_factory.h" diff --git a/parser/tensorflow/tensorflow_util.cc b/parser/tensorflow/tensorflow_util.cc index 3a05ffb..86c45a6 100644 --- a/parser/tensorflow/tensorflow_util.cc +++ b/parser/tensorflow/tensorflow_util.cc @@ -19,8 +19,8 @@ #include #include #include +#include "common/string_util.h" #include "framework/common/debug/ge_log.h" -#include "framework/common/debug/log.h" #include "framework/common/op/ge_op_utils.h" #include "framework/omg/parser/parser_types.h" #include "graph/debug/ge_attr_define.h" diff --git a/parser/tensorflow/tensorflow_var_is_initialized_op_parser.cc b/parser/tensorflow/tensorflow_var_is_initialized_op_parser.cc index 4ec74bd..ef3e47b 100644 --- a/parser/tensorflow/tensorflow_var_is_initialized_op_parser.cc +++ b/parser/tensorflow/tensorflow_var_is_initialized_op_parser.cc @@ -15,7 +15,7 @@ */ #include "framework/common/debug/ge_log.h" -#include "framework/common/util.h" +//#include "common/util.h" #include "framework/common/op/ge_op_utils.h" #include "parser/common/op_def/var_is_initialized_op_op.h" #include "parser/common/op_parser_factory.h" diff --git a/parser/tensorflow/tensorflow_variable_v2_parser.cc b/parser/tensorflow/tensorflow_variable_v2_parser.cc index c8b8a98..39ad0ec 100644 --- a/parser/tensorflow/tensorflow_variable_v2_parser.cc +++ b/parser/tensorflow/tensorflow_variable_v2_parser.cc @@ -15,7 +15,6 @@ */ #include "framework/common/debug/ge_log.h" -#include "framework/common/debug/log.h" #include "framework/common/op/ge_op_utils.h" #include "graph/compute_graph.h" #include "graph/ge_attr_value.h"