diff --git a/parser/caffe/caffe_data_parser.cc b/parser/caffe/caffe_data_parser.cc index 87d9679..75fe56c 100644 --- a/parser/caffe/caffe_data_parser.cc +++ b/parser/caffe/caffe_data_parser.cc @@ -94,7 +94,7 @@ Status CaffeDataParser::ParseParamsForInput(const domi::caffe::LayerParameter *l const ge::ParserContext &ctx = GetParserContext(); std::map> input_dims = ctx.input_dims; string name = layer->name(); - auto search = input_dims.find(name); + std::map>::const_iterator search = input_dims.find(name); if (search == input_dims.end()) { REPORT_INPUT_ERROR("E11005", std::vector({"input"}), std::vector({layer->name()})); GELOGE(PARAM_INVALID, "[Check][Param] Caffe prototxt has no input_param or user " @@ -139,7 +139,7 @@ Status CaffeDataParser::ParseParamsForDummyData(const domi::caffe::LayerParamete const ge::ParserContext &ctx = GetParserContext(); std::map> input_dims = ctx.input_dims; string name = layer->name(); - auto search = input_dims.find(name); + std::map>::const_iterator search = input_dims.find(name); if (search == input_dims.end()) { REPORT_INPUT_ERROR("E11005", std::vector({"input"}), std::vector({layer->name()})); GELOGE(PARAM_INVALID, "[Check][Param] Caffe prototxt has no input_param or user " diff --git a/parser/caffe/caffe_op_parser.cc b/parser/caffe/caffe_op_parser.cc index 820a122..f2e6612 100644 --- a/parser/caffe/caffe_op_parser.cc +++ b/parser/caffe/caffe_op_parser.cc @@ -19,6 +19,7 @@ #include "parser/common/op_parser_factory.h" #include "common/util/error_manager/error_manager.h" #include "framework/omg/parser/parser_types.h" +#include "graph/def_types.h" using namespace ge::parser; using domi::caffe::BlobProto; @@ -107,7 +108,7 @@ Status CaffeOpParser::ParseWeightType(const BlobProto &proto, const ge::GeShape for (int i = 0; i < size; ++i) { buf[i] = proto.double_data(i); } - GE_IF_BOOL_EXEC(weight->SetData(reinterpret_cast(buf.get()), size * sizeof(float)) != ge::GRAPH_SUCCESS, + GE_IF_BOOL_EXEC(weight->SetData(PtrToPtr(buf.get()), size * sizeof(float)) != ge::GRAPH_SUCCESS, GELOGW("SetData failed for GeTensor.");); // no need to return } else if (proto.int8_data().length() > 0) { if (size != static_cast(proto.int8_data().length())) { @@ -121,7 +122,7 @@ Status CaffeOpParser::ParseWeightType(const BlobProto &proto, const ge::GeShape const char *data_ptr = proto.int8_data().data(); GE_CHECK_NOTNULL(data_ptr); GE_IF_BOOL_EXEC( - weight->SetData(reinterpret_cast(data_ptr), size * sizeof(int8_t)) != ge::GRAPH_SUCCESS, + weight->SetData(PtrToPtr(data_ptr), size * sizeof(int8_t)) != ge::GRAPH_SUCCESS, GELOGW("SetData failed for GeTensor.");); // no need to return dtype = ge::DT_INT8; } else if (proto.int32_data_size() > 0) { @@ -139,7 +140,7 @@ Status CaffeOpParser::ParseWeightType(const BlobProto &proto, const ge::GeShape int32_weight_buf[i] = proto.int32_data(i); } GE_IF_BOOL_EXEC( - weight->SetData(reinterpret_cast(int32_weight_buf.get()), size * sizeof(int32_t)) != ge::GRAPH_SUCCESS, + weight->SetData(PtrToPtr(int32_weight_buf.get()), size * sizeof(int32_t)) != ge::GRAPH_SUCCESS, GELOGW("SetData failed for GeTensor.");); // no need to return dtype = ge::DT_INT32; } else if (proto.uint64_data_size() > 0) { @@ -156,7 +157,7 @@ Status CaffeOpParser::ParseWeightType(const BlobProto &proto, const ge::GeShape for (int i = 0; i < size; ++i) { uint64_weight_buf[i] = proto.uint64_data(i); } - GE_IF_BOOL_EXEC(weight->SetData(reinterpret_cast(uint64_weight_buf.get()), size * sizeof(uint64_t)) != + GE_IF_BOOL_EXEC(weight->SetData(PtrToPtr(uint64_weight_buf.get()), size * sizeof(uint64_t)) != ge::GRAPH_SUCCESS, GELOGW("SetData failed for GeTensor.");); // no need to return dtype = ge::DT_UINT64; @@ -173,7 +174,7 @@ Status CaffeOpParser::ParseWeightType(const BlobProto &proto, const ge::GeShape const float *data_ptr = proto.data().data(); GE_CHECK_NOTNULL(data_ptr); GE_IF_BOOL_EXEC( - weight->SetData(reinterpret_cast(data_ptr), size * sizeof(float)) != ge::GRAPH_SUCCESS, + weight->SetData(PtrToPtr(data_ptr), size * sizeof(float)) != ge::GRAPH_SUCCESS, GELOGW("SetData failed for GeTensor.");); // no need to return } ge::GeTensorDesc weight_desc = ge::GeTensorDesc(); diff --git a/parser/caffe/caffe_parser.cc b/parser/caffe/caffe_parser.cc index f29ef45..3bdd931 100644 --- a/parser/caffe/caffe_parser.cc +++ b/parser/caffe/caffe_parser.cc @@ -755,7 +755,8 @@ Status CaffeModelParser::GetCustomOp(const domi::caffe::LayerParameter &layer, v } if (is_search_built_in_layer) { - const google::protobuf::Message *layer_message = reinterpret_cast(&layer); + const google::protobuf::Message *layer_message = PtrToPtr(&layer); Status status = CreateCustomOperator(op_name, op_type, layer_message, 0, operators); if (status != SUCCESS || operators.empty()) { GELOGE(status, "[Create][CustomOperator] failed, name: %s, type: %s.", op_name.c_str(), op_type.c_str()); @@ -1025,7 +1026,8 @@ Status CaffeModelParser::AddEdges(ge::ComputeGraphPtr &graph) { // Find the layer for this output auto top_node_iter = node_map.find(top_blob_layer_pair.first); // Find the layer for this input - auto bottom_node_iter = node_map.find(bottom_blob_layer_pair.first); + std::map::const_iterator bottom_node_iter = + node_map.find(bottom_blob_layer_pair.first); if (top_node_iter != node_map.end() && bottom_node_iter != node_map.end()) { // Output node top_node_iter->second, // Output index top_blob_layer_pair.second @@ -1095,7 +1097,7 @@ Status CaffeModelParser::AddUserOutNodesTop() { const std::vector> &user_out_nodes = ge::GetParserContext().user_out_nodes; int net_output_num = user_out_nodes.size(); for (const auto &out_pair : user_out_nodes) { - auto layer_iter = layer_tops_map_.find(out_pair.first); + std::map>::const_iterator layer_iter = layer_tops_map_.find(out_pair.first); GELOGI("Add to output, node name: %s", out_pair.first.c_str()); if (layer_iter != layer_tops_map_.end()) { if (static_cast(out_pair.second) >= (layer_iter->second).size()) { @@ -1110,7 +1112,7 @@ Status CaffeModelParser::AddUserOutNodesTop() { } string top_name = layer_iter->second[out_pair.second]; - auto top_node_iter = node_map.find(out_pair.first); + std::map::const_iterator top_node_iter = node_map.find(out_pair.first); if (top_node_iter != node_map.end()) { ge::GetParserContext().out_tensor_names.push_back(top_name); GELOGI("The top of out node [%s] is [%s]", out_pair.first.c_str(), top_name.c_str()); @@ -1142,7 +1144,8 @@ Status CaffeModelParser::AddOutputTop(const domi::caffe::NetParameter &proto_mes top = RemapTopNameByLayer(layer, top, i); } - auto t_iter = top_blobs_map_.find(top); + std::map>>::const_iterator t_iter = + top_blobs_map_.find(top); GE_RETURN_WITH_LOG_IF_FALSE(t_iter != top_blobs_map_.end(), "[Check][Param]Failed to find top: %s, layer name:%s", top.c_str(), @@ -1156,7 +1159,7 @@ Status CaffeModelParser::AddOutputTop(const domi::caffe::NetParameter &proto_mes // If not found, add to the output side of the output // Find the layer for this output - auto top_node_iter = node_map.find(layer.name()); + std::map::const_iterator top_node_iter = node_map.find(layer.name()); GELOGI("output in top_blob: %s", layer.name().c_str()); if (top_node_iter != node_map.end()) { ge::GetParserContext().out_tensor_names.push_back(top_origin); @@ -1392,7 +1395,7 @@ void CaffeModelParser::SaveOrigionLayerTops(domi::caffe::LayerParameter &layer) for (auto top : layer.top()) { tops.push_back(top); } - auto it = layer_tops_map_.find(name); + std::map>::const_iterator it = layer_tops_map_.find(name); if (it == layer_tops_map_.end()) { layer_tops_map_[name] = tops; } @@ -1679,7 +1682,7 @@ Status CaffeWeightsParser::ParseFromMemory(const char *data, uint32_t size, ge:: // Resolve proto file to netparameter NetParameter proto; - bool success = ge::parser::ReadProtoFromArray(reinterpret_cast(data), static_cast(size), &proto); + bool success = ge::parser::ReadProtoFromArray(data, static_cast(size), &proto); if (!success) { REPORT_CALL_ERROR("E19999", "ReadProtoFromArray failed."); GELOGE(domi::PARSE_WEIGHTS_FAILED, "[Read][Proto] from Memory fail"); @@ -1920,7 +1923,7 @@ Status CaffeWeightsParser::ParseLayerField(const google::protobuf::Reflection *r const google::protobuf::FieldDescriptor *field, google::protobuf::Message *layer) { GELOGD("Start to parse field: %s.", field->name().c_str()); - domi::caffe::LayerParameter *layer_proto = reinterpret_cast(layer); + domi::caffe::LayerParameter *layer_proto = PtrToPtr(layer); string filed_name = field->name(); #define CASE_FIELD_NAME(kName, method) \ if (filed_name == kField##kName) { \ @@ -1975,8 +1978,7 @@ Status CaffeWeightsParser::ConvertBlobsProto(const google::protobuf::Message *me CAFFE_CHECK_NULL_AND_REPROT_ERRORMSG(blobs_reflection, "Get Reflection failed in google::protobuf::Message"); vector field_desc; blobs_reflection->ListFields(*message, &field_desc); - - domi::caffe::BlobProto *blobs_proto = reinterpret_cast(blobs); + domi::caffe::BlobProto *blobs_proto = PtrToPtr(blobs); for (auto &field : field_desc) { GE_CHECK_NOTNULL(field); @@ -2025,7 +2027,7 @@ Status CaffeWeightsParser::ConvertBlobShapeProto(const google::protobuf::Message vector field_desc; reflection->ListFields(*message, &field_desc); - domi::caffe::BlobShape *shape_proto = reinterpret_cast(dest_message); + domi::caffe::BlobShape *shape_proto = PtrToPtr(dest_message); for (auto &field : field_desc) { if (field->name() != kFieldDim) { @@ -2048,7 +2050,7 @@ Status CaffeWeightsParser::ConvertConvParamProto(const google::protobuf::Message reflection->ListFields(*message, &field_desc); domi::caffe::ConvolutionParameter *conv_param_proto = - reinterpret_cast(dest_message); + PtrToPtr(dest_message); for (auto &field : field_desc) { if (field->name() != kFieldBiasTerm) { @@ -2068,7 +2070,7 @@ Status CaffeWeightsParser::ConvertInnerProdcutProto(const google::protobuf::Mess reflection->ListFields(*message, &field_desc); domi::caffe::InnerProductParameter *inner_product_proto = - reinterpret_cast(dest_message); + PtrToPtr(dest_message); for (auto &field : field_desc) { if (field->name() != kFieldBiasTerm) { @@ -2125,7 +2127,8 @@ Status CaffeWeightsParser::CheckLayersSize(const google::protobuf::Message *mess Status CaffeWeightsParser::ConvertLayerParameter(const google::protobuf::Message *layer_message, ge::ComputeGraphPtr &graph) { vector need_share_layers; - const domi::caffe::LayerParameter *layer = reinterpret_cast(layer_message); + const domi::caffe::LayerParameter *layer = + PtrToPtr(layer_message); const string &shared_layer_name = layer->name(); const string &layer_type = layer->type(); for (auto p_iter = params_share_map.begin(); p_iter != params_share_map.end(); ++p_iter) { @@ -2159,7 +2162,7 @@ Status CaffeWeightsParser::ConvertLayerParameter(const google::protobuf::Message } // The weight processing also needs to judge the duplicate operator, which is reserved here and processed later. - auto iter = caffe_op_map.find(layer_type); + std::map::const_iterator iter = caffe_op_map.find(layer_type); if (iter == caffe_op_map.end()) { GELOGW("Unrecognized layer type %s , layer name: %s, layer ignored.", layer_type.c_str(), layer_name.c_str()); continue; @@ -2285,7 +2288,7 @@ Status CaffeWeightsParser::ConvertNetParameter(const NetParameter ¶m, ge::Co } // The weight processing also needs to judge the duplicate operator, which is reserved here and processed later. - auto iter = caffe_op_map.find(layer.type()); + std::map::const_iterator iter = caffe_op_map.find(layer.type()); if (iter == caffe_op_map.end()) { GELOGW("Unrecognized layer type %s , layer name: %s, layer ignored.", layer.type().c_str(), layer_name.c_str()); continue; diff --git a/parser/caffe/caffe_reshape_parser.cc b/parser/caffe/caffe_reshape_parser.cc index 15b5be0..7175b09 100644 --- a/parser/caffe/caffe_reshape_parser.cc +++ b/parser/caffe/caffe_reshape_parser.cc @@ -128,7 +128,7 @@ Status CaffeReshapeParser::AddConstInput(ge::NodePtr &node) { data[i] = attr_shape[i]; } GE_IF_BOOL_EXEC( - constTensor->SetData(reinterpret_cast(data.get()), dims_size * sizeof(int64_t)) != ge::GRAPH_SUCCESS, + constTensor->SetData(PtrToPtr(data.get()), dims_size * sizeof(int64_t)) != ge::GRAPH_SUCCESS, GELOGW("SetData failed for GeTensor.");); // no need to return // construct const node and add edge diff --git a/parser/common/acl_graph_parser_util.cc b/parser/common/acl_graph_parser_util.cc index e1ca2ae..6e8a753 100644 --- a/parser/common/acl_graph_parser_util.cc +++ b/parser/common/acl_graph_parser_util.cc @@ -492,7 +492,7 @@ domi::Status AclGrphParseUtil::GetOutputLeaf(NodePtr node, } domi::Status AclGrphParseUtil::GetDefaultOutInfo(ge::ComputeGraphPtr &compute_graph, - std::vector> &output_nodes_info) { + std::vector> &output_nodes_info) { std::vector> default_out_nodes = ge::GetParserContext().default_out_nodes; if (!default_out_nodes.empty()) { for (size_t i = 0; i < default_out_nodes.size(); ++i) { @@ -820,7 +820,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool ReadProtoFromArray(const v "or size is 0, check invalid"); return false, "[Check][Param]incorrect parameter. proto is nullptr || data is nullptr || size is 0"); - google::protobuf::io::CodedInputStream coded_stream(reinterpret_cast(const_cast(data)), size); + google::protobuf::io::CodedInputStream coded_stream(PtrToPtr(const_cast(data)), size); return ReadProtoFromCodedInputStream(coded_stream, proto); } @@ -901,7 +901,7 @@ Status GetOriginalType(const ge::NodePtr &node, string &type) { return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY bool ValidateStr(const std::string &str, const std::string &mode) { +FMK_FUNC_HOST_VISIBILITY bool ValidateStr(const std::string &filePath, const std::string &mode) { char ebuff[kMaxBuffSize]; regex_t reg; int cflags = REG_EXTENDED | REG_NOSUB; @@ -913,7 +913,7 @@ FMK_FUNC_HOST_VISIBILITY bool ValidateStr(const std::string &str, const std::str return true; } - ret = regexec(®, str.c_str(), 0, nullptr, 0); + ret = regexec(®, filePath.c_str(), 0, nullptr, 0); if (ret) { regerror(ret, ®, ebuff, kMaxBuffSize); GELOGE(ge::PARAM_INVALID, "[Invoke][RegExec] failed, reason: %s", ebuff); diff --git a/parser/common/data_op_parser.h b/parser/common/data_op_parser.h index 0f2f2fe..da2f15a 100644 --- a/parser/common/data_op_parser.h +++ b/parser/common/data_op_parser.h @@ -60,7 +60,7 @@ class DataOpParser { * @param [in] 4D shape information (dimensions) * @param [out] Save converted shap information */ - static Status Init5DInputTensor(const std::vector &shape, ge::GeTensorDesc &tensorDesc); + static Status Init5DInputTensor(const std::vector &shape, ge::GeTensorDesc &tensor_desc); /** * @ingroup domi_omg @@ -98,7 +98,7 @@ class DataOpParser { * @return SUCCESS Convert success * @return FAILED Convert failed */ - static Status InitNDTensor(const std::vector &shape, ge::DataType data_type, ge::GeTensorDesc &desc); + static Status InitNDTensor(const std::vector &shape, ge::DataType data_type, ge::GeTensorDesc &tensor_desc); }; } // namespace ge diff --git a/parser/common/op_def/ir_pb_converter.cc b/parser/common/op_def/ir_pb_converter.cc index 9c39d26..d4849c8 100644 --- a/parser/common/op_def/ir_pb_converter.cc +++ b/parser/common/op_def/ir_pb_converter.cc @@ -114,7 +114,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY domi::Status ConvertToOpDesc(co if (op_attr_pair.second.value_.value_case() == domi::AttrDef::kBt) { auto &buffer = op_attr_pair.second.value_.bt(); (void)ge::AttrUtils::SetZeroCopyBytes(op_def, op_attr_pair.first, - ge::Buffer::CopyFrom(reinterpret_cast(const_cast(buffer.data())), buffer.size())); + ge::Buffer::CopyFrom(PtrToPtr(const_cast(buffer.data())), buffer.size())); } if (op_attr_pair.second.value_.value_case() == domi::AttrDef::kS) { diff --git a/parser/common/op_parser_factory.cc b/parser/common/op_parser_factory.cc index 527cc96..34b1543 100644 --- a/parser/common/op_parser_factory.cc +++ b/parser/common/op_parser_factory.cc @@ -50,7 +50,7 @@ FMK_FUNC_HOST_VISIBILITY std::shared_ptr OpParserFactory::Insta // Instances cannot be a member of a class because they may be used before initialization, resulting in a run error. static std::map> instances; - auto iter = instances.find(framework); + std::map>::const_iterator iter = instances.find(framework); if (iter == instances.end()) { std::shared_ptr instance(new (std::nothrow) OpParserFactory()); if (instance == nullptr) { @@ -67,7 +67,7 @@ FMK_FUNC_HOST_VISIBILITY std::shared_ptr OpParserFactory::Insta FMK_FUNC_HOST_VISIBILITY std::shared_ptr OpParserFactory::CreateOpParser(const std::string &op_type) { // First look for CREATOR_FUN based on OpType, then call CREATOR_FUN to create OpParser. - auto iter = op_parser_creator_map_.find(op_type); + std::map::const_iterator iter = op_parser_creator_map_.find(op_type); if (iter != op_parser_creator_map_.end()) { return iter->second(); } @@ -78,7 +78,7 @@ FMK_FUNC_HOST_VISIBILITY std::shared_ptr OpParserFactory::CreateOpPars FMK_FUNC_HOST_VISIBILITY std::shared_ptr OpParserFactory::CreateFusionOpParser(const std::string &op_type) { // First look for CREATOR_FUN based on OpType, then call CREATOR_FUN to create OpParser. - auto iter = fusion_op_parser_creator_map_.find(op_type); + std::map::const_iterator iter = fusion_op_parser_creator_map_.find(op_type); if (iter != fusion_op_parser_creator_map_.end()) { return iter->second(); } @@ -102,12 +102,12 @@ FMK_FUNC_HOST_VISIBILITY void OpParserFactory::RegisterCreator(const std::string FMK_FUNC_HOST_VISIBILITY bool OpParserFactory::OpParserIsRegistered(const std::string &op_type, bool is_fusion_op) { if (is_fusion_op) { - auto iter = fusion_op_parser_creator_map_.find(op_type); + std::map::const_iterator iter = fusion_op_parser_creator_map_.find(op_type); if (iter != fusion_op_parser_creator_map_.end()) { return true; } } else { - auto iter = op_parser_creator_map_.find(op_type); + std::map::const_iterator iter = op_parser_creator_map_.find(op_type); if (iter != op_parser_creator_map_.end()) { return true; } diff --git a/parser/common/pass_manager.h b/parser/common/pass_manager.h index 5befe03..46ecb5a 100644 --- a/parser/common/pass_manager.h +++ b/parser/common/pass_manager.h @@ -62,7 +62,7 @@ public: /// @return others optimized failed /// @author /// - static Status Run(const ge::ComputeGraphPtr &graph, std::vector> &passes); + static Status Run(const ge::ComputeGraphPtr &graph, std::vector> &names_to_passes); ~PassManager(); diff --git a/parser/common/proto_file_parser.cc b/parser/common/proto_file_parser.cc index f47e1a6..af4a4d0 100644 --- a/parser/common/proto_file_parser.cc +++ b/parser/common/proto_file_parser.cc @@ -425,7 +425,8 @@ Status ProtoFileParser::FindConflictLine(const char *proto_file, int identifier, void ProtoFileParser::CheckConflictOp(const char *caffe_proto_file, const char *custom_proto_file, std::map> &caffe_op_identifier_map, std::map> &custom_op_identifier_map) { - for (auto iter = custom_op_identifier_map.begin(); iter != custom_op_identifier_map.end(); ++iter) { + std::map>::const_iterator iter = custom_op_identifier_map.begin(); + for (; iter != custom_op_identifier_map.end(); ++iter) { if (caffe_op_identifier_map.count(iter->first) > 0) { string message_name = iter->first; auto caffe_pair = caffe_op_identifier_map[iter->first]; @@ -452,7 +453,8 @@ void ProtoFileParser::CheckConflictOp(const char *caffe_proto_file, const char * void ProtoFileParser::CheckConflictIdentifier(const char *caffe_proto_file, const char *custom_proto_file, std::map> caffe_identifier_op_map, std::map> custom_identifier_op_map) { - for (auto iter = custom_identifier_op_map.begin(); iter != custom_identifier_op_map.end(); ++iter) { + std::map>::const_iterator iter = custom_identifier_op_map.begin(); + for (; iter != custom_identifier_op_map.end(); ++iter) { if (caffe_identifier_op_map.count(iter->first) > 0) { int identifier = iter->first; auto caffe_pair = caffe_identifier_op_map[iter->first]; diff --git a/parser/common/tbe_plugin_loader.cc b/parser/common/tbe_plugin_loader.cc index 6173274..08ff44a 100644 --- a/parser/common/tbe_plugin_loader.cc +++ b/parser/common/tbe_plugin_loader.cc @@ -105,7 +105,7 @@ void TBEPluginLoader::GetCustomOpPath(std::string &customop_path) { GELOGI("Enter get custom op path schedule"); std::string fmk_type; domi::FrameworkType type = domi::TENSORFLOW; - auto it = options_.find(FRAMEWORK_TYPE); + std::map::const_iterator it = options_.find(FRAMEWORK_TYPE); if (it != options_.end()) { type = static_cast(std::strtol(it->second.c_str(), nullptr, 10)); } diff --git a/parser/onnx/onnx_constant_parser.cc b/parser/onnx/onnx_constant_parser.cc index 56e43a7..bb01e0e 100644 --- a/parser/onnx/onnx_constant_parser.cc +++ b/parser/onnx/onnx_constant_parser.cc @@ -71,7 +71,7 @@ Status OnnxConstantParser::ParseConvertData(const ge::onnx::TensorProto &tensor_ }; int32_t datatype_val_size = 0; - auto iter = datatype_val_size_map.find(data_type); + std::map::const_iterator iter = datatype_val_size_map.find(data_type); if (iter != datatype_val_size_map.end()) { datatype_val_size = iter->second; } else { @@ -91,7 +91,7 @@ Status OnnxConstantParser::ParseConvertData(const ge::onnx::TensorProto &tensor_ if (data_type == OnnxDataType::STRING) { tensor.SetData(tensor_proto.raw_data().c_str()); } else { - tensor.SetData(reinterpret_cast(tensor_proto.raw_data().c_str()), + tensor.SetData(PtrToPtr(tensor_proto.raw_data().c_str()), tensor_proto.raw_data().size()); } GELOGD("Raw data size is : %zu", tensor_proto.raw_data().size()); diff --git a/parser/onnx/onnx_constant_parser.h b/parser/onnx/onnx_constant_parser.h index 6ad4468..0178787 100644 --- a/parser/onnx/onnx_constant_parser.h +++ b/parser/onnx/onnx_constant_parser.h @@ -65,7 +65,7 @@ class PARSER_FUNC_VISIBILITY OnnxConstantParser : public OnnxOpParser { *(addr_trans.get() + i) = static_cast( std::fabs(*((addr).get() + i)) > std::numeric_limits::epsilon()); } - (tensor).SetData(reinterpret_cast(addr_trans.get()), (count) * sizeof(bool)); + (tensor).SetData(PtrToPtr(addr_trans.get()), (count) * sizeof(bool)); break; } #define CASE_SET_DATA(dt_type, value_type, addr, count, tensor) \ diff --git a/parser/onnx/onnx_parser.cc b/parser/onnx/onnx_parser.cc index 98f47fd..4e3fb04 100644 --- a/parser/onnx/onnx_parser.cc +++ b/parser/onnx/onnx_parser.cc @@ -384,7 +384,7 @@ Status OnnxModelParser::ConstructOriType(const ge::onnx::NodeProto *node_proto, std::string domain = node_proto->domain(); int64_t version = 0; if (!domain.empty()) { - auto it = domain_verseion_.find(domain); + std::map::const_iterator it = domain_verseion_.find(domain); if (it != domain_verseion_.end()) { version = it->second; } else { @@ -493,14 +493,14 @@ Status OnnxModelParser::SetOperatorInputs() { std::vector> &output_node_indexs = out_iter->second; for (auto input_node_index : input_node_indexs) { for (auto out_node_index : output_node_indexs) { - auto input_op_iter = name_operator_.find(input_node_index.first); + std::map::const_iterator input_op_iter = name_operator_.find(input_node_index.first); if (input_op_iter == name_operator_.end()) { REPORT_INNER_ERROR("E19999", "Node: %s can not find in name_operator map.", input_node_index.first.c_str()); GELOGE(INTERNAL_ERROR, "[Check][Param] Node: %s can not find in name_operator map.", input_node_index.first.c_str()); return INTERNAL_ERROR; } - auto output_op_iter = name_operator_.find(out_node_index.first); + std::map::const_iterator output_op_iter = name_operator_.find(out_node_index.first); if (output_op_iter == name_operator_.end()) { REPORT_INNER_ERROR("E19999", "Node: %s can not find in name_operator map.", out_node_index.first.c_str()); GELOGE(INTERNAL_ERROR, "[Check][Param] Node: %s can not find in name_operator map.", @@ -665,7 +665,7 @@ Status OnnxModelParser::GetGraphInputs(ge::onnx::GraphProto &onnx_graph, std::ve } } for (auto in_name : input_node_names_) { - auto in_op = name_operator_.find(in_name); + std::map::const_iterator in_op = name_operator_.find(in_name); if (in_op == name_operator_.end()) { GELOGE(PARAM_INVALID, "[Get][Inputs] Model assigned input node name: %s can not find in graph.", in_name.c_str()); @@ -682,7 +682,8 @@ Status OnnxModelParser::GetGraphInputs(ge::onnx::GraphProto &onnx_graph, std::ve Status OnnxModelParser::GetGraphOutputs(std::vector>> &output_ops, ParserUtils::OutputMapping &out_tensor_to_nodes) { for (auto output_name : output_node_names_) { - auto itr = outputs_map_.find(output_name); + std::map>>::const_iterator itr = + outputs_map_.find(output_name); if (itr == outputs_map_.end()) { GELOGE(PARAM_INVALID, "[Get][Outputs] Can not find output:%s in graph.", output_name.c_str()); REPORT_INNER_ERROR("E19999", "[Get][Outputs] Can not find output:%s in graph.", output_name.c_str()); @@ -692,7 +693,7 @@ Status OnnxModelParser::GetGraphOutputs(std::vector> node_names_indexes = itr->second; for (const auto &node_name_index : node_names_indexes) { auto node_name = node_name_index.first; - auto out_op_itr = name_operator_.find(node_name); + std::map::const_iterator out_op_itr = name_operator_.find(node_name); if (out_op_itr == name_operator_.end()) { GELOGE(PARAM_INVALID, "[Get][Operator] Can not find operator: %s in graph.", node_name.c_str()); REPORT_INNER_ERROR("E19999", "Can not find operator: %s in graph.", node_name.c_str()); @@ -815,7 +816,7 @@ Status OnnxModelParser::ModelParseToGraph(const ge::onnx::ModelProto &onnx_model bool is_subgraph = (arg.parent_node != nullptr) ? true : false; if (arg.onnx_graph == nullptr) { - auto itr = name_to_onnx_graph.find(arg.graph_name); + std::map::const_iterator itr = name_to_onnx_graph.find(arg.graph_name); if (itr == name_to_onnx_graph.end()) { GELOGE(FAILED, "[Find][OnnxGraph] Can not find onnx graph, graph:%s.", arg.graph_name.c_str()); REPORT_INNER_ERROR("E19999", "Can not find onnx graph, graph:%s.", arg.graph_name.c_str()); diff --git a/parser/onnx/onnx_parser.h b/parser/onnx/onnx_parser.h index acec764..899a8d0 100644 --- a/parser/onnx/onnx_parser.h +++ b/parser/onnx/onnx_parser.h @@ -96,7 +96,7 @@ class PARSER_FUNC_VISIBILITY OnnxModelParser : public domi::ModelParser { Status ConstructOriType(const ge::onnx::NodeProto *node_proto, std::string &ori_type); - Status AdapterOpType(const ge::onnx::NodeProto *node_proto, std::string &ori_type, std::string &om_type); + Status AdapterOpType(const ge::onnx::NodeProto *node_proto, std::string &ori_type, std::string &op_type); Status TransNodeToOperator(const ge::onnx::NodeProto *node_proto, ge::Operator &op, const string &op_type) const; @@ -106,7 +106,7 @@ class PARSER_FUNC_VISIBILITY OnnxModelParser : public domi::ModelParser { Status GetGraphInputs(ge::onnx::GraphProto &onnx_graph, std::vector &input_ops); - Status GetGraphOutputs(std::vector>> &outputs, + Status GetGraphOutputs(std::vector>> &output_ops, ParserUtils::OutputMapping &out_tensor_to_nodes); Status Prechecker(ge::onnx::GraphProto &onnx_graph); @@ -115,7 +115,7 @@ class PARSER_FUNC_VISIBILITY OnnxModelParser : public domi::ModelParser { Status GetModelFromMemory(const char *data, uint32_t size, ge::onnx::ModelProto &onnx_model) const; - Status ModelParseToGraph(const ge::onnx::ModelProto &onnx_model, ge::Graph &graph); + Status ModelParseToGraph(const ge::onnx::ModelProto &onnx_model, ge::Graph &root_graph); Status ModelParseToGraphImpl(bool is_subgraph, ge::onnx::GraphProto &onnx_graph, ge::Graph &graph); diff --git a/parser/onnx/subgraph_adapter/if_subgraph_adapter.cc b/parser/onnx/subgraph_adapter/if_subgraph_adapter.cc index 50f8531..cf26a98 100644 --- a/parser/onnx/subgraph_adapter/if_subgraph_adapter.cc +++ b/parser/onnx/subgraph_adapter/if_subgraph_adapter.cc @@ -104,7 +104,7 @@ domi::Status IfSubgraphAdapter::GetSubgraphsAllInputs(ge::onnx::GraphProto &onnx } for (const auto &input : graph_inputs) { - auto out_iter = graph_outputs.find(input); + std::set::const_iterator out_iter = graph_outputs.find(input); if (out_iter == graph_outputs.end()) { // Record input node need to be constructed all_inputs.emplace(input); diff --git a/parser/onnx/subgraph_adapter/if_subgraph_adapter.h b/parser/onnx/subgraph_adapter/if_subgraph_adapter.h index 2723a86..9b6f1e5 100644 --- a/parser/onnx/subgraph_adapter/if_subgraph_adapter.h +++ b/parser/onnx/subgraph_adapter/if_subgraph_adapter.h @@ -24,7 +24,7 @@ namespace ge { class PARSER_FUNC_VISIBILITY IfSubgraphAdapter : public SubgraphAdapter { public: - domi::Status AdaptAndFindAllSubgraphs(ge::onnx::NodeProto *parent_op, + domi::Status AdaptAndFindAllSubgraphs(ge::onnx::NodeProto *parent_node, std::vector &onnx_graphs, std::map &name_to_onnx_graph) override; diff --git a/parser/onnx/subgraph_adapter/subgraph_adapter_factory.cc b/parser/onnx/subgraph_adapter/subgraph_adapter_factory.cc index 489018e..cb45db0 100644 --- a/parser/onnx/subgraph_adapter/subgraph_adapter_factory.cc +++ b/parser/onnx/subgraph_adapter/subgraph_adapter_factory.cc @@ -26,7 +26,7 @@ SubgraphAdapterFactory* SubgraphAdapterFactory::Instance() { std::shared_ptr SubgraphAdapterFactory::CreateSubgraphAdapter( const std::string &op_type) { // First look for CREATOR_FUN based on OpType, then call CREATOR_FUN to create SubgraphAdapter. - auto iter = subgraph_adapter_creator_map_.find(op_type); + std::map::const_iterator iter = subgraph_adapter_creator_map_.find(op_type); if (iter != subgraph_adapter_creator_map_.end()) { return iter->second(); } diff --git a/parser/tensorflow/graph_functiondef.cc b/parser/tensorflow/graph_functiondef.cc index 2208c0d..51ebf37 100644 --- a/parser/tensorflow/graph_functiondef.cc +++ b/parser/tensorflow/graph_functiondef.cc @@ -227,7 +227,7 @@ domi::Status GraphToFunctionDef::RecordResult(ge::ComputeGraphPtr graph, GE_CHECK_NOTNULL(anchor); GE_CHECK_NOTNULL(anchor->GetOwnerNode()->GetOpDesc()); int32_t type = anchor->GetOwnerNode()->GetOpDesc()->GetOutputDesc(anchor->GetIdx()).GetDataType(); - auto iter = GE_TENSORFLOW_DATA_TYPE_MAP.find(type); + std::map::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find(type); GE_IF_BOOL_EXEC(iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(), REPORT_INNER_ERROR("E19999", "datatype:%d of output:%d in node:%s:%s is not supported", type, anchor->GetIdx(), anchor->GetOwnerNode()->GetName().c_str(), @@ -304,7 +304,7 @@ domi::Status GraphToFunctionDef::RecordArg(ge::ComputeGraphPtr graph, const vect GE_CHECK_NOTNULL_EXEC(tensor_desc_ptr, return domi::FAILED); int32_t type = tensor_desc_ptr->GetDataType(); - auto iter = GE_TENSORFLOW_DATA_TYPE_MAP.find(type); + std::map::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find(type); GE_IF_BOOL_EXEC(iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(), REPORT_INNER_ERROR("E19999", "datatype:%d of input:%d in node:%s:%s is not supported", type, anchor->GetIdx(), anchor->GetOwnerNode()->GetName().c_str(), diff --git a/parser/tensorflow/graph_functiondef.h b/parser/tensorflow/graph_functiondef.h index 4f3a505..ae27885 100644 --- a/parser/tensorflow/graph_functiondef.h +++ b/parser/tensorflow/graph_functiondef.h @@ -52,7 +52,7 @@ class GraphToFunctionDef { const string &name, FunctionDef *fdef); static domi::Status BuildFunctionDef(ge::ComputeGraphPtr &graph, - const string &nme_in, + const string &name_in, FunctionDefLibrary *library, NodeDef *call_node_def, vector &in_anchor, diff --git a/parser/tensorflow/graph_optimizer.cc b/parser/tensorflow/graph_optimizer.cc index 95d9189..bd6b6f5 100644 --- a/parser/tensorflow/graph_optimizer.cc +++ b/parser/tensorflow/graph_optimizer.cc @@ -178,7 +178,7 @@ Status CollectNodeFuncs(vector &nodes, FunctionDefLibrary *library) GE_IF_BOOL_EXEC( AttrUtils::GetBytes(opDef, ge::ATTR_NAME_FRAMEWORK_FUNC_DEF, funcDefBytes), FunctionDefLibrary funcLib; GE_CHECK_NOTNULL(funcDefBytes.GetData()); - string str(reinterpret_cast(funcDefBytes.GetData()), funcDefBytes.GetSize()); + string str(PtrToPtr(funcDefBytes.GetData()), funcDefBytes.GetSize()); GELOGI("FUNCDEF: Get function -> %s.", str.c_str()); GE_IF_BOOL_EXEC( funcLib.ParseFromArray(funcDefBytes.GetData(), funcDefBytes.GetSize()), library->MergeFrom(funcLib))); } @@ -250,10 +250,10 @@ Status ParserGraphOptimizer::UpdateGraph(vector &nodes) { (void)AttrUtils::SetZeroCopyBytes( fusion_node_opdef, ge::ATTR_NAME_FRAMEWORK_FUNC_DEF, - Buffer::CopyFrom(reinterpret_cast(funcdefStr.data()), funcdefStr.length())); + Buffer::CopyFrom(PtrToPtr(funcdefStr.data()), funcdefStr.length())); (void)AttrUtils::SetZeroCopyBytes( fusion_node_opdef, ge::ATTR_NAME_FRAMEWORK_NODE_DEF, - Buffer::CopyFrom(reinterpret_cast(nodefStr.data()), nodefStr.length())); + Buffer::CopyFrom(PtrToPtr(nodefStr.data()), nodefStr.length())); (void)AttrUtils::SetInt(fusion_node_opdef, ge::ATTR_NAME_FRAMEWORK_FWK_TYPE, ge::GetParserContext().type); @@ -381,7 +381,7 @@ Status ParserGraphOptimizer::RebuildOutputAnchors(vector & GE_CHK_BOOL_EXEC(fusion_op_desc->AddOutputDesc(src_out_desc) == ge::GRAPH_SUCCESS, return FAILED); ge::DataType data_type = src_out_desc.GetDataType(); - std::map::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find((int32_t)data_type); + const std::map::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find((int32_t)data_type); GE_IF_BOOL_EXEC( iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(), REPORT_INNER_ERROR("E19999", "datatype:%d of output:%d in node:%s:%s is not supported", @@ -417,7 +417,7 @@ Status ParserGraphOptimizer::RebuildInputAnchors(vector &in return FAILED, "Add fusion_op_desc AddInputDesc failed"); ge::DataType data_type = tensorDescPtr->GetDataType(); - std::map::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find((int32_t)data_type); + const std::map::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find((int32_t)data_type); GE_IF_BOOL_EXEC( iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(), REPORT_INNER_ERROR("E19999", "datatype:%d of input:%d in node:%s:%s is not supported", diff --git a/parser/tensorflow/tensorflow_auto_mapping_parser_adapter.cc b/parser/tensorflow/tensorflow_auto_mapping_parser_adapter.cc index cd11bf4..bc50850 100644 --- a/parser/tensorflow/tensorflow_auto_mapping_parser_adapter.cc +++ b/parser/tensorflow/tensorflow_auto_mapping_parser_adapter.cc @@ -130,7 +130,7 @@ Status TensorFlowAutoMappingParserAdapter::ParseParams(const Message *op_src, ge (void)AttrUtils::SetZeroCopyBytes( op_dest, ge::ATTR_NAME_FRAMEWORK_NODE_DEF, - Buffer::CopyFrom(reinterpret_cast(serialized_node.data()), serialized_node.length())); + Buffer::CopyFrom(PtrToPtr(serialized_node.data()), serialized_node.length())); GELOGI("node_def of %s is %s.", op_dest->GetName().c_str(), serialized_node.c_str()); } diff --git a/parser/tensorflow/tensorflow_fusion_op_parser.h b/parser/tensorflow/tensorflow_fusion_op_parser.h index 3aed4b2..68d1425 100644 --- a/parser/tensorflow/tensorflow_fusion_op_parser.h +++ b/parser/tensorflow/tensorflow_fusion_op_parser.h @@ -44,7 +44,7 @@ class PARSER_FUNC_VISIBILITY TensorFlowFusionOpParser : public TensorFlowOpParse * @return SUCCESS Parsing success * @return FAILED Parsing failed */ - virtual Status ParseParams(const std::vector &v_input_const, ge::NodePtr &node) const; + virtual Status ParseParams(const std::vector &v_input_const, ge::NodePtr &op_dest) const; /** * @ingroup domi_omg diff --git a/parser/tensorflow/tensorflow_parser.cc b/parser/tensorflow/tensorflow_parser.cc index 81dc181..7b6de47 100644 --- a/parser/tensorflow/tensorflow_parser.cc +++ b/parser/tensorflow/tensorflow_parser.cc @@ -54,6 +54,7 @@ #include "register/register_utils.h" #include "register/scope/scope_pass_registry_impl.h" #include "parser/common/auto_mapping_subgraph_io_index_func.h" +#include "graph/def_types.h" using ge::OpParserFactory; using ge::Pb2Json; @@ -1375,7 +1376,7 @@ Status TensorFlowModelParser::Parse(const char *model_path, ge::ComputeGraphPtr } } - std::map::const_iterator + const std::map::const_iterator iter = function_name_to_graphdef.find(arg.function_name); if (iter == function_name_to_graphdef.end()) { ErrorManager::GetInstance().ATCReportErrMessage("E12013", {"functionname"}, {arg.function_name}); @@ -1868,7 +1869,7 @@ Status TensorFlowModelParser::UpdateAllNodeOpContext(shared_ptr ge::ScopeFusionOpInfo info; if (IsFusionOpChild(op_node_name, &info) && nodedef_map_[op_node_name]->op() != TENSORFLOWF_NODE_OP_CONST) { // This node is a fusion operator - std::map::const_iterator + const std::map::const_iterator fusion_iter = tmp_fusion_op_node_context_map.find(info.fusion_node_name); if (fusion_iter == tmp_fusion_op_node_context_map.end()) { OpNodeContext op_node_context; @@ -2119,7 +2120,7 @@ Status TensorFlowModelParser::NormalizeInputOrOutputMap( } string name = to_string(pair.first) + ":" + to_string(pair.second); - std::set::const_iterator compare_iter = compare_set.find(name); + const std::set::const_iterator compare_iter = compare_set.find(name); if (compare_iter != compare_set.end()) { // pair repeat, ignore continue; @@ -2158,7 +2159,7 @@ void TensorFlowModelParser::SaveEdgesControlInfo(const string &node_name, const } void TensorFlowModelParser::UpdateEdgesControlInfo(const ge::ScopeFusionOpInfo &info) { - std::map>::const_iterator iter = edges_control_map.find(info.node_name); + const std::map>::const_iterator iter = edges_control_map.find(info.node_name); if (iter != edges_control_map.end()) { // Delete the original fusion operator node information and add the fusion operator control edge information edges_control_map.erase(iter); @@ -2415,7 +2416,7 @@ Status TensorFlowModelParser::ParseProto(const std::string &serialized_proto, ge GELOGE(FAILED, "Proto object GraphDef parse serialized proto failed"); return FAILED; } - return ParseProto(reinterpret_cast(&graph_def), graph); + return ParseProto(ge::PtrToPtr(&graph_def), graph); } Status TensorFlowModelParser::ParseProtoWithSubgraph(const std::string &root_proto, domi::GetGraphCallbackV2 callback, @@ -2482,7 +2483,7 @@ Status TensorFlowModelParser::OptimizeIdentityByOutput(map &n return INTERNAL_ERROR, "Can't find op node context."); OpNodeContext op_node_context = context_iter->second; - std::map::const_iterator node_def_iter = nodedef_map.find(curr_node_name); + const std::map::const_iterator node_def_iter = nodedef_map.find(curr_node_name); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( (node_def_iter == nodedef_map.end()), REPORT_INNER_ERROR("E19999", "Node:%s can't find in nodedef_map, check invalid", curr_node_name.c_str()); @@ -2506,7 +2507,8 @@ Status TensorFlowModelParser::OptimizeIdentityByOutput(map &n // Deal with non _Retval output operator of Identity. if (has_out_retval) { - for (auto output_iter = output_map.begin(); output_iter != output_map.end(); ++output_iter) { + std::map>>::const_iterator output_iter = output_map.begin(); + for (; output_iter != output_map.end(); ++output_iter) { const string &output_node_name = output_iter->first; domi::tensorflow::NodeDef *output_node_def = nodedef_map[output_node_name]; GE_CHECK_NOTNULL(output_node_def); @@ -3902,7 +3904,7 @@ Status TensorFlowModelParser::AddFusionNodeDef(shared_ptr &scope DumpAllNodeContext("BeforeAddFusionNodeDef"); for (size_t i = 0; i < op_node_list_size; ++i) { const string op_node_name = node_name_list[i]; - auto iter = fusion_op_nodedef_map_.find(op_node_name); + std::map>::const_iterator iter = fusion_op_nodedef_map_.find(op_node_name); if (iter != fusion_op_nodedef_map_.end()) { vector fusion_op_info = fusion_op_type_map_[op_node_name]; if (fusion_op_info[0] != ge::kScopeToMultiNodes) { @@ -4059,7 +4061,7 @@ Status TensorFlowModelParser::AddExternalGraph(const ComputeGraphPtr &root_graph std::string model_data; if (AttrUtils::GetStr(node->GetOpDesc(), kExternalModel, model_data) && !model_data.empty()) { ge::Model model; - auto load_ret = ge::Model::Load(reinterpret_cast(model_data.data()), model_data.size(), model); + auto load_ret = ge::Model::Load(ge::PtrToPtr(model_data.data()), model_data.size(), model); if (load_ret != GRAPH_SUCCESS) { GELOGE(INTERNAL_ERROR, "[Parse][ExternalModel]Node:%s.", node->GetName().c_str()); REPORT_CALL_ERROR("E19999", "Failed to parse external model, node:%s.", node->GetName().c_str()); diff --git a/parser/tensorflow/tensorflow_parser.h b/parser/tensorflow/tensorflow_parser.h index 7f7124e..6b196cd 100644 --- a/parser/tensorflow/tensorflow_parser.h +++ b/parser/tensorflow/tensorflow_parser.h @@ -130,7 +130,7 @@ class PARSER_FUNC_VISIBILITY TensorFlowModelParser : public domi::ModelParser { Status ParseProtoWithSubgraph(const google::protobuf::Message *root_proto, domi::GetGraphCallback callback, - ge::ComputeGraphPtr &graph) override; + ge::ComputeGraphPtr &root_graph) override; /* * @ingroup domi_omg diff --git a/parser/tensorflow/tensorflow_reshape_parser.h b/parser/tensorflow/tensorflow_reshape_parser.h index d0d2c3f..2d2a9bd 100644 --- a/parser/tensorflow/tensorflow_reshape_parser.h +++ b/parser/tensorflow/tensorflow_reshape_parser.h @@ -34,7 +34,7 @@ class PARSER_FUNC_VISIBILITY TensorFlowReshapeParser : public TensorFlowOpParser * @return FAILED parse failed * @author */ - Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; + Status ParseParams(const Message *op_src, ge::OpDescPtr &op) override; }; } // namespace ge diff --git a/parser/tensorflow/tensorflow_squeeze_parser.h b/parser/tensorflow/tensorflow_squeeze_parser.h index b7675b3..c2bba6f 100644 --- a/parser/tensorflow/tensorflow_squeeze_parser.h +++ b/parser/tensorflow/tensorflow_squeeze_parser.h @@ -22,7 +22,7 @@ namespace ge { class PARSER_FUNC_VISIBILITY TensorFlowSqueezeParser : public TensorFlowOpParser { public: - Status ParseParams(const Message *op_src, ge::OpDescPtr &op_dest) override; + Status ParseParams(const Message *op_src, ge::OpDescPtr &op) override; private: static Status ParseDesc(const domi::tensorflow::AttrValue &attr_value, ge::GeTensorDesc &ge_desc);