From 98d65d1ebcd426268988ed9c5e34fd1183c9f543 Mon Sep 17 00:00:00 2001 From: xuyf Date: Fri, 2 Sep 2022 10:03:08 +0000 Subject: [PATCH] !640 clean code Merge pull request !640 from xuyf/ge_dev --- parser/CMakeLists.txt | 22 +++++++++++----------- parser/common/convert/message2operator.cc | 2 +- parser/common/convert/message2operator.h | 2 +- parser/common/convert/pb2json.cc | 10 ++++------ parser/common/convert/pb2json.h | 2 +- .../op_def/{arg_op.cc => arg_op_operator.cc} | 4 ++-- .../common/op_def/{arg_op.h => arg_op_operator.h} | 2 +- .../{constant_op.cc => constant_operator.cc} | 4 ++-- .../op_def/{constant_op.h => constant_operator.h} | 2 +- .../common/op_def/{fill_op.cc => fill_operator.cc} | 4 ++-- .../common/op_def/{fill_op.h => fill_operator.h} | 2 +- ...{frameworkop_op.cc => framework_op_operator.cc} | 4 ++-- .../{frameworkop_op.h => framework_op_operator.h} | 2 +- parser/common/op_def/ir_pb_converter.cc | 2 +- parser/common/op_def/ir_pb_converter.h | 2 +- .../op_def/{no_op_op.cc => no_op_operator.cc} | 4 ++-- .../common/op_def/{no_op_op.h => no_op_operator.h} | 3 +-- parser/common/op_def/operator.cc | 2 +- parser/common/op_def/operator.h | 2 +- .../{ref_switch_op.cc => ref_switch_operator.cc} | 4 ++-- .../{ref_switch_op.h => ref_switch_operator.h} | 2 +- .../op_def/{shape_n_op.cc => shape_n_operator.cc} | 4 ++-- .../op_def/{shape_n_op.h => shape_n_operator.h} | 2 +- ..._op_op.cc => var_is_initialized_op_operator.cc} | 4 ++-- ...ed_op_op.h => var_is_initialized_op_operator.h} | 2 +- .../{variable_op.cc => variable_operator.cc} | 4 ++-- .../op_def/{variable_op.h => variable_operator.h} | 2 +- parser/module.mk | 22 +++++++++++----------- ...aph_functiondef.cc => graph_to_function_def.cc} | 4 ++-- ...graph_functiondef.h => graph_to_function_def.h} | 2 +- parser/tensorflow/iterator_fusion_pass.cc | 4 ++-- parser/tensorflow/iterator_fusion_pass.h | 2 +- ...raph_optimizer.cc => parser_graph_optimizer.cc} | 9 ++++++--- ...{graph_optimizer.h => parser_graph_optimizer.h} | 2 +- parser/tensorflow/scope/scope_pass_manager.cc | 2 +- parser/tensorflow/scope/scope_pass_manager.h | 2 +- parser/tensorflow/tensorflow_arg_parser.cc | 4 ++-- .../tensorflow_auto_mapping_parser_adapter.cc | 2 +- .../tensorflow_auto_mapping_parser_adapter.h | 2 +- parser/tensorflow/tensorflow_constant_parser.cc | 2 +- parser/tensorflow/tensorflow_constant_parser.h | 2 +- parser/tensorflow/tensorflow_fill_parser.cc | 2 +- parser/tensorflow/tensorflow_frameworkop_parser.cc | 2 +- parser/tensorflow/tensorflow_no_op_parser.cc | 2 +- parser/tensorflow/tensorflow_ref_switch_parser.cc | 2 +- parser/tensorflow/tensorflow_ref_switch_parser.h | 2 +- parser/tensorflow/tensorflow_shape_n_parser.cc | 2 +- parser/tensorflow/tensorflow_shape_n_parser.h | 2 +- .../tensorflow_var_is_initialized_op_parser.cc | 2 +- parser/tensorflow/tensorflow_variable_v2_parser.cc | 2 +- tests/st/CMakeLists.txt | 22 +++++++++++----------- tests/st/testcase/test_tensorflow_parser.cc | 19 ++++++++++--------- tests/ut/parser/CMakeLists.txt | 22 +++++++++++----------- .../graph_optimizer_unittest.cc | 2 +- .../tensorflow_parser_unittest.cc | 18 +++++++++--------- 55 files changed, 132 insertions(+), 131 deletions(-) rename parser/common/op_def/{arg_op.cc => arg_op_operator.cc} (89%) rename parser/common/op_def/{arg_op.h => arg_op_operator.h} (89%) rename parser/common/op_def/{constant_op.cc => constant_operator.cc} (91%) rename parser/common/op_def/{constant_op.h => constant_operator.h} (93%) rename parser/common/op_def/{fill_op.cc => fill_operator.cc} (92%) rename parser/common/op_def/{fill_op.h => fill_operator.h} (93%) rename parser/common/op_def/{frameworkop_op.cc => framework_op_operator.cc} (95%) rename parser/common/op_def/{frameworkop_op.h => framework_op_operator.h} (94%) rename parser/common/op_def/{no_op_op.cc => no_op_operator.cc} (87%) rename parser/common/op_def/{no_op_op.h => no_op_operator.h} (90%) rename parser/common/op_def/{ref_switch_op.cc => ref_switch_operator.cc} (89%) rename parser/common/op_def/{ref_switch_op.h => ref_switch_operator.h} (93%) rename parser/common/op_def/{shape_n_op.cc => shape_n_operator.cc} (93%) rename parser/common/op_def/{shape_n_op.h => shape_n_operator.h} (94%) rename parser/common/op_def/{var_is_initialized_op_op.cc => var_is_initialized_op_operator.cc} (89%) rename parser/common/op_def/{var_is_initialized_op_op.h => var_is_initialized_op_operator.h} (93%) rename parser/common/op_def/{variable_op.cc => variable_operator.cc} (92%) rename parser/common/op_def/{variable_op.h => variable_operator.h} (94%) rename parser/tensorflow/{graph_functiondef.cc => graph_to_function_def.cc} (99%) rename parser/tensorflow/{graph_functiondef.h => graph_to_function_def.h} (97%) rename parser/tensorflow/{graph_optimizer.cc => parser_graph_optimizer.cc} (99%) rename parser/tensorflow/{graph_optimizer.h => parser_graph_optimizer.h} (97%) diff --git a/parser/CMakeLists.txt b/parser/CMakeLists.txt index e203166..ce8a6e0 100644 --- a/parser/CMakeLists.txt +++ b/parser/CMakeLists.txt @@ -22,18 +22,18 @@ set(SRC_LIST "caffe/caffe_custom_parser_adapter.cc" "caffe/caffe_op_parser.cc" "tensorflow/scope/scope_pass_manager.cc" - "tensorflow/graph_functiondef.cc" - "tensorflow/graph_optimizer.cc" + "tensorflow/graph_to_function_def.cc" + "tensorflow/parser_graph_optimizer.cc" "tensorflow/iterator_fusion_pass.cc" - "common/op_def/arg_op.cc" - "common/op_def/constant_op.cc" - "common/op_def/fill_op.cc" - "common/op_def/frameworkop_op.cc" - "common/op_def/no_op_op.cc" - "common/op_def/ref_switch_op.cc" - "common/op_def/shape_n_op.cc" - "common/op_def/var_is_initialized_op_op.cc" - "common/op_def/variable_op.cc" + "common/op_def/arg_op_operator.cc" + "common/op_def/constant_operator.cc" + "common/op_def/fill_operator.cc" + "common/op_def/framework_op_operator.cc" + "common/op_def/no_op_operator.cc" + "common/op_def/ref_switch_operator.cc" + "common/op_def/shape_n_operator.cc" + "common/op_def/var_is_initialized_op_operator.cc" + "common/op_def/variable_operator.cc" ) ############ libfmk_parser.so ############ diff --git a/parser/common/convert/message2operator.cc b/parser/common/convert/message2operator.cc index d58762f..d235ac2 100644 --- a/parser/common/convert/message2operator.cc +++ b/parser/common/convert/message2operator.cc @@ -1,5 +1,5 @@ /** - * Copyright 2021 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/convert/message2operator.h b/parser/common/convert/message2operator.h index b8610e9..b247112 100644 --- a/parser/common/convert/message2operator.h +++ b/parser/common/convert/message2operator.h @@ -1,5 +1,5 @@ /** - * Copyright 2021 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/convert/pb2json.cc b/parser/common/convert/pb2json.cc index 66097b8..0b3dd2b 100644 --- a/parser/common/convert/pb2json.cc +++ b/parser/common/convert/pb2json.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -82,7 +82,7 @@ void Pb2Json::OneField2Json(const ProtobufMsg &message, const ProtobufFieldDescr switch (field->type()) { case ProtobufFieldDescriptor::TYPE_MESSAGE: { const ProtobufMsg &tmp_message = reflection->GetMessage(message, field); - if (0UL != tmp_message.ByteSizeLong()) { + if (tmp_message.ByteSizeLong() != 0UL) { Message2Json(tmp_message, black_fields, json[field->name()], enum2str, depth + 1); } break; @@ -122,7 +122,7 @@ void Pb2Json::OneField2Json(const ProtobufMsg &message, const ProtobufFieldDescr case ProtobufFieldDescriptor::TYPE_FLOAT: char str[kSignificantDigits]; - if (sprintf_s(str, kSignificantDigits, "%g", reflection->GetFloat(message, field)) != -1){ + if (sprintf_s(str, kSignificantDigits, "%g", reflection->GetFloat(message, field)) != -1) { json[field->name()] = str; } else { json[field->name()] = reflection->GetFloat(message, field); @@ -155,10 +155,8 @@ string Pb2Json::TypeBytes2String(string &field_name, string &type_bytes) { } string result = ""; for (char temp_value : type_bytes) { - uint8_t *value = 0; - value = reinterpret_cast(&temp_value); char str[kSignificantDigits]; - if (sprintf_s(str, kSignificantDigits, "%d", *value) == -1){ + if (sprintf_s(str, kSignificantDigits, "%c", temp_value) == -1) { GELOGW("Convert bytes to string fail, filed name:%s", field_name.c_str()); continue; } diff --git a/parser/common/convert/pb2json.h b/parser/common/convert/pb2json.h index 28e796d..9e48d06 100644 --- a/parser/common/convert/pb2json.h +++ b/parser/common/convert/pb2json.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/op_def/arg_op.cc b/parser/common/op_def/arg_op_operator.cc similarity index 89% rename from parser/common/op_def/arg_op.cc rename to parser/common/op_def/arg_op_operator.cc index 2eb0ff6..5e06525 100644 --- a/parser/common/op_def/arg_op.cc +++ b/parser/common/op_def/arg_op_operator.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "parser/common/op_def/arg_op.h" +#include "parser/common/op_def/arg_op_operator.h" #include #include "framework/common/fmk_types.h" diff --git a/parser/common/op_def/arg_op.h b/parser/common/op_def/arg_op_operator.h similarity index 89% rename from parser/common/op_def/arg_op.h rename to parser/common/op_def/arg_op_operator.h index 7258422..3746471 100644 --- a/parser/common/op_def/arg_op.h +++ b/parser/common/op_def/arg_op_operator.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/op_def/constant_op.cc b/parser/common/op_def/constant_operator.cc similarity index 91% rename from parser/common/op_def/constant_op.cc rename to parser/common/op_def/constant_operator.cc index ce9d249..db17752 100644 --- a/parser/common/op_def/constant_op.cc +++ b/parser/common/op_def/constant_operator.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "common/op_def/constant_op.h" +#include "common/op_def/constant_operator.h" #include #include diff --git a/parser/common/op_def/constant_op.h b/parser/common/op_def/constant_operator.h similarity index 93% rename from parser/common/op_def/constant_op.h rename to parser/common/op_def/constant_operator.h index e329ac1..6f809b3 100644 --- a/parser/common/op_def/constant_op.h +++ b/parser/common/op_def/constant_operator.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/op_def/fill_op.cc b/parser/common/op_def/fill_operator.cc similarity index 92% rename from parser/common/op_def/fill_op.cc rename to parser/common/op_def/fill_operator.cc index 2228d26..9b2ee5d 100644 --- a/parser/common/op_def/fill_op.cc +++ b/parser/common/op_def/fill_operator.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "common/op_def/fill_op.h" +#include "common/op_def/fill_operator.h" #include "framework/common/fmk_types.h" namespace ge { diff --git a/parser/common/op_def/fill_op.h b/parser/common/op_def/fill_operator.h similarity index 93% rename from parser/common/op_def/fill_op.h rename to parser/common/op_def/fill_operator.h index 4040b49..b556067 100644 --- a/parser/common/op_def/fill_op.h +++ b/parser/common/op_def/fill_operator.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/op_def/frameworkop_op.cc b/parser/common/op_def/framework_op_operator.cc similarity index 95% rename from parser/common/op_def/frameworkop_op.cc rename to parser/common/op_def/framework_op_operator.cc index 7810147..305fac0 100644 --- a/parser/common/op_def/frameworkop_op.cc +++ b/parser/common/op_def/framework_op_operator.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "common/op_def/frameworkop_op.h" +#include "common/op_def/framework_op_operator.h" #include #include "framework/common/fmk_types.h" diff --git a/parser/common/op_def/frameworkop_op.h b/parser/common/op_def/framework_op_operator.h similarity index 94% rename from parser/common/op_def/frameworkop_op.h rename to parser/common/op_def/framework_op_operator.h index 9a1a54c..eafc1a5 100644 --- a/parser/common/op_def/frameworkop_op.h +++ b/parser/common/op_def/framework_op_operator.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/op_def/ir_pb_converter.cc b/parser/common/op_def/ir_pb_converter.cc index 9dd7f64..87c56ac 100644 --- a/parser/common/op_def/ir_pb_converter.cc +++ b/parser/common/op_def/ir_pb_converter.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/op_def/ir_pb_converter.h b/parser/common/op_def/ir_pb_converter.h index bbc8e03..fea9dd2 100644 --- a/parser/common/op_def/ir_pb_converter.h +++ b/parser/common/op_def/ir_pb_converter.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/op_def/no_op_op.cc b/parser/common/op_def/no_op_operator.cc similarity index 87% rename from parser/common/op_def/no_op_op.cc rename to parser/common/op_def/no_op_operator.cc index d9706ef..d630beb 100644 --- a/parser/common/op_def/no_op_op.cc +++ b/parser/common/op_def/no_op_operator.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -15,7 +15,7 @@ */ // AUTO GEN PLEASE DO NOT MODIFY IT -#include "common/op_def/no_op_op.h" +#include "common/op_def/no_op_operator.h" #include namespace ge { diff --git a/parser/common/op_def/no_op_op.h b/parser/common/op_def/no_op_operator.h similarity index 90% rename from parser/common/op_def/no_op_op.h rename to parser/common/op_def/no_op_operator.h index f3bfea8..56338c2 100644 --- a/parser/common/op_def/no_op_op.h +++ b/parser/common/op_def/no_op_operator.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -18,7 +18,6 @@ #ifndef DOMI_OP_NO_OP_OP_H_ #define DOMI_OP_NO_OP_OP_H_ #include "parser/common/op_def/operator.h" -#include "framework/omg/parser/parser_types.h" namespace ge { class NoOpOperator : public ParserOperator { diff --git a/parser/common/op_def/operator.cc b/parser/common/op_def/operator.cc index 8db5a75..15296e9 100644 --- a/parser/common/op_def/operator.cc +++ b/parser/common/op_def/operator.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/op_def/operator.h b/parser/common/op_def/operator.h index a97580f..28fce69 100644 --- a/parser/common/op_def/operator.h +++ b/parser/common/op_def/operator.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/op_def/ref_switch_op.cc b/parser/common/op_def/ref_switch_operator.cc similarity index 89% rename from parser/common/op_def/ref_switch_op.cc rename to parser/common/op_def/ref_switch_operator.cc index 5331676..cc02f81 100644 --- a/parser/common/op_def/ref_switch_op.cc +++ b/parser/common/op_def/ref_switch_operator.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -15,7 +15,7 @@ */ // AUTO GEN PLEASE DO NOT MODIFY IT -#include "common/op_def/ref_switch_op.h" +#include "common/op_def/ref_switch_operator.h" namespace ge { FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY RefSwitchOperator::RefSwitchOperator() : ParserOperator("RefSwitch") {} diff --git a/parser/common/op_def/ref_switch_op.h b/parser/common/op_def/ref_switch_operator.h similarity index 93% rename from parser/common/op_def/ref_switch_op.h rename to parser/common/op_def/ref_switch_operator.h index 6a09bea..becbf28 100644 --- a/parser/common/op_def/ref_switch_op.h +++ b/parser/common/op_def/ref_switch_operator.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/op_def/shape_n_op.cc b/parser/common/op_def/shape_n_operator.cc similarity index 93% rename from parser/common/op_def/shape_n_op.cc rename to parser/common/op_def/shape_n_operator.cc index d5d64dc..df2a7d9 100644 --- a/parser/common/op_def/shape_n_op.cc +++ b/parser/common/op_def/shape_n_operator.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -15,7 +15,7 @@ */ // AUTO GEN PLEASE DO NOT MODIFY IT -#include "common/op_def/shape_n_op.h" +#include "common/op_def/shape_n_operator.h" #include "graph/debug/ge_attr_define.h" #include "framework/omg/parser/parser_types.h" diff --git a/parser/common/op_def/shape_n_op.h b/parser/common/op_def/shape_n_operator.h similarity index 94% rename from parser/common/op_def/shape_n_op.h rename to parser/common/op_def/shape_n_operator.h index e60c70c..ce9aa2e 100644 --- a/parser/common/op_def/shape_n_op.h +++ b/parser/common/op_def/shape_n_operator.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/op_def/var_is_initialized_op_op.cc b/parser/common/op_def/var_is_initialized_op_operator.cc similarity index 89% rename from parser/common/op_def/var_is_initialized_op_op.cc rename to parser/common/op_def/var_is_initialized_op_operator.cc index ad3013d..81f7f4e 100644 --- a/parser/common/op_def/var_is_initialized_op_op.cc +++ b/parser/common/op_def/var_is_initialized_op_operator.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -15,7 +15,7 @@ */ // AUTO GEN PLEASE DO NOT MODIFY IT -#include "common/op_def/var_is_initialized_op_op.h" +#include "common/op_def/var_is_initialized_op_operator.h" #include #include diff --git a/parser/common/op_def/var_is_initialized_op_op.h b/parser/common/op_def/var_is_initialized_op_operator.h similarity index 93% rename from parser/common/op_def/var_is_initialized_op_op.h rename to parser/common/op_def/var_is_initialized_op_operator.h index 1c8ac5e..a0c2a32 100644 --- a/parser/common/op_def/var_is_initialized_op_op.h +++ b/parser/common/op_def/var_is_initialized_op_operator.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/common/op_def/variable_op.cc b/parser/common/op_def/variable_operator.cc similarity index 92% rename from parser/common/op_def/variable_op.cc rename to parser/common/op_def/variable_operator.cc index 5be9600..8d200ec 100644 --- a/parser/common/op_def/variable_op.cc +++ b/parser/common/op_def/variable_operator.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "parser/common/op_def/variable_op.h" +#include "parser/common/op_def/variable_operator.h" #include "graph/debug/ge_attr_define.h" diff --git a/parser/common/op_def/variable_op.h b/parser/common/op_def/variable_operator.h similarity index 94% rename from parser/common/op_def/variable_op.h rename to parser/common/op_def/variable_operator.h index 3326657..76d60a1 100644 --- a/parser/common/op_def/variable_op.h +++ b/parser/common/op_def/variable_operator.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/module.mk b/parser/module.mk index 678179c..524b6a9 100644 --- a/parser/module.mk +++ b/parser/module.mk @@ -92,18 +92,18 @@ PARSER_SCOPE_SRC_FILES := \ tensorflow/scope/scope_pass_manager.cc \ FMK_COMMON_SRC_FILES := \ - tensorflow/graph_functiondef.cc \ - tensorflow/graph_optimizer.cc \ + tensorflow/graph_to_function_def.cc \ + tensorflow/parser_graph_optimizer.cc \ tensorflow/iterator_fusion_pass.cc \ - common/op_def/arg_op.cc \ - common/op_def/constant_op.cc \ - common/op_def/fill_op.cc \ - common/op_def/frameworkop_op.cc \ - common/op_def/no_op_op.cc \ - common/op_def/ref_switch_op.cc \ - common/op_def/shape_n_op.cc \ - common/op_def/var_is_initialized_op_op.cc \ - common/op_def/variable_op.cc \ + common/op_def/arg_op_operator.cc \ + common/op_def/constant_operator.cc \ + common/op_def/fill_operator.cc \ + common/op_def/framework_op_operator.cc \ + common/op_def/no_op_operator.cc \ + common/op_def/ref_switch_operator.cc \ + common/op_def/shape_n_operator.cc \ + common/op_def/var_is_initialized_op_operator.cc \ + common/op_def/variable_operator.cc \ LOCAL_SRC_FILES := $(PARSER_TENSORFLOW_SRC_FILES) LOCAL_SRC_FILES += $(PARSER_SCOPE_SRC_FILES) diff --git a/parser/tensorflow/graph_functiondef.cc b/parser/tensorflow/graph_to_function_def.cc similarity index 99% rename from parser/tensorflow/graph_functiondef.cc rename to parser/tensorflow/graph_to_function_def.cc index 983d8a6..9629cfc 100644 --- a/parser/tensorflow/graph_functiondef.cc +++ b/parser/tensorflow/graph_to_function_def.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd +* Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "graph_functiondef.h" +#include "graph_to_function_def.h" #include #include "common/fmk_error_codes.h" #include "graph/debug/ge_attr_define.h" diff --git a/parser/tensorflow/graph_functiondef.h b/parser/tensorflow/graph_to_function_def.h similarity index 97% rename from parser/tensorflow/graph_functiondef.h rename to parser/tensorflow/graph_to_function_def.h index ae27885..081a022 100644 --- a/parser/tensorflow/graph_functiondef.h +++ b/parser/tensorflow/graph_to_function_def.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/tensorflow/iterator_fusion_pass.cc b/parser/tensorflow/iterator_fusion_pass.cc index 14fcf9a..2a7f2a8 100644 --- a/parser/tensorflow/iterator_fusion_pass.cc +++ b/parser/tensorflow/iterator_fusion_pass.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -20,7 +20,7 @@ #include "framework/omg/parser/parser_types.h" #include "common/util.h" -#include "graph_optimizer.h" +#include "parser_graph_optimizer.h" #include "framework/common/ge_inner_error_codes.h" namespace ge { diff --git a/parser/tensorflow/iterator_fusion_pass.h b/parser/tensorflow/iterator_fusion_pass.h index 268613f..0756bb9 100644 --- a/parser/tensorflow/iterator_fusion_pass.h +++ b/parser/tensorflow/iterator_fusion_pass.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/tensorflow/graph_optimizer.cc b/parser/tensorflow/parser_graph_optimizer.cc similarity index 99% rename from parser/tensorflow/graph_optimizer.cc rename to parser/tensorflow/parser_graph_optimizer.cc index e9c8799..9046292 100644 --- a/parser/tensorflow/graph_optimizer.cc +++ b/parser/tensorflow/parser_graph_optimizer.cc @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "graph_optimizer.h" +#include "parser_graph_optimizer.h" #include "graph/op_types.h" #include "common/types_map.h" #include "common/util.h" #include "framework/omg/parser/parser_inner_ctx.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/type_utils.h" -#include "graph_functiondef.h" +#include "graph_to_function_def.h" #include "parser/common/acl_graph_parser_util.h" #include "register/op_registry.h" @@ -188,7 +188,10 @@ Status CollectNodeFuncs(vector &nodes, FunctionDefLibrary *library) Status ParserGraphOptimizer::UpdateGraph(vector &nodes) { ComputeGraphPtr sub_graph = nullptr; - GE_MAKE_SHARED(sub_graph = std::make_shared("subGraph"), sub_graph = nullptr; return PARAM_INVALID); + GE_MAKE_SHARED( + sub_graph = std::make_shared("subGraph"), + sub_graph = nullptr; + return PARAM_INVALID); unordered_map node_map; vector input_anchors; diff --git a/parser/tensorflow/graph_optimizer.h b/parser/tensorflow/parser_graph_optimizer.h similarity index 97% rename from parser/tensorflow/graph_optimizer.h rename to parser/tensorflow/parser_graph_optimizer.h index 728230e..6fee699 100644 --- a/parser/tensorflow/graph_optimizer.h +++ b/parser/tensorflow/parser_graph_optimizer.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/tensorflow/scope/scope_pass_manager.cc b/parser/tensorflow/scope/scope_pass_manager.cc index b4a3a65..d715e20 100644 --- a/parser/tensorflow/scope/scope_pass_manager.cc +++ b/parser/tensorflow/scope/scope_pass_manager.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/tensorflow/scope/scope_pass_manager.h b/parser/tensorflow/scope/scope_pass_manager.h index d661003..2f24b28 100644 --- a/parser/tensorflow/scope/scope_pass_manager.h +++ b/parser/tensorflow/scope/scope_pass_manager.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/tensorflow/tensorflow_arg_parser.cc b/parser/tensorflow/tensorflow_arg_parser.cc index afa6097..985eb15 100644 --- a/parser/tensorflow/tensorflow_arg_parser.cc +++ b/parser/tensorflow/tensorflow_arg_parser.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "parser/common/op_def/arg_op.h" +#include "parser/common/op_def/arg_op_operator.h" #include "framework/common/debug/ge_log.h" #include "framework/omg/parser/parser_inner_ctx.h" #include "graph/compute_graph.h" diff --git a/parser/tensorflow/tensorflow_auto_mapping_parser_adapter.cc b/parser/tensorflow/tensorflow_auto_mapping_parser_adapter.cc index 3fc99de..89a2ee8 100644 --- a/parser/tensorflow/tensorflow_auto_mapping_parser_adapter.cc +++ b/parser/tensorflow/tensorflow_auto_mapping_parser_adapter.cc @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/tensorflow/tensorflow_auto_mapping_parser_adapter.h b/parser/tensorflow/tensorflow_auto_mapping_parser_adapter.h index 9b4cf52..f7bc8f5 100644 --- a/parser/tensorflow/tensorflow_auto_mapping_parser_adapter.h +++ b/parser/tensorflow/tensorflow_auto_mapping_parser_adapter.h @@ -1,5 +1,5 @@ /** - * Copyright 2020 Huawei Technologies Co., Ltd + * Copyright (c) Huawei Technologies Co., Ltd. 2022. 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. diff --git a/parser/tensorflow/tensorflow_constant_parser.cc b/parser/tensorflow/tensorflow_constant_parser.cc index 22f1647..9812b37 100644 --- a/parser/tensorflow/tensorflow_constant_parser.cc +++ b/parser/tensorflow/tensorflow_constant_parser.cc @@ -19,7 +19,7 @@ #include #include #include "parser/common/acl_graph_parser_util.h" -#include "parser/common/op_def/constant_op.h" +#include "parser/common/op_def/constant_operator.h" #include "parser/common/op_def/ir_pb_converter.h" #include "parser/common/util.h" #include "framework/common/debug/ge_log.h" diff --git a/parser/tensorflow/tensorflow_constant_parser.h b/parser/tensorflow/tensorflow_constant_parser.h index 557db3d..5d4df36 100644 --- a/parser/tensorflow/tensorflow_constant_parser.h +++ b/parser/tensorflow/tensorflow_constant_parser.h @@ -17,7 +17,7 @@ #ifndef GE_PARSER_TENSORFLOW_TENSORFLOW_CONSTANT_PARSER_H_ #define GE_PARSER_TENSORFLOW_TENSORFLOW_CONSTANT_PARSER_H_ -#include "common/op_def/constant_op.h" +#include "common/op_def/constant_operator.h" #include "parser/common/data_op_parser.h" #include "parser/tensorflow/tensorflow_op_parser.h" diff --git a/parser/tensorflow/tensorflow_fill_parser.cc b/parser/tensorflow/tensorflow_fill_parser.cc index 886dcdb..fab2eb9 100644 --- a/parser/tensorflow/tensorflow_fill_parser.cc +++ b/parser/tensorflow/tensorflow_fill_parser.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "parser/common/op_def/fill_op.h" +#include "parser/common/op_def/fill_operator.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 2d03c7b..cb9ccff 100644 --- a/parser/tensorflow/tensorflow_frameworkop_parser.cc +++ b/parser/tensorflow/tensorflow_frameworkop_parser.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "parser/common/op_def/frameworkop_op.h" +#include "parser/common/op_def/framework_op_operator.h" #include "framework/common/debug/ge_log.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 4d43f9d..efd193a 100644 --- a/parser/tensorflow/tensorflow_no_op_parser.cc +++ b/parser/tensorflow/tensorflow_no_op_parser.cc @@ -18,7 +18,7 @@ #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" +#include "parser/common/op_def/no_op_operator.h" #include "parser/common/op_parser_factory.h" using domi::TENSORFLOW; diff --git a/parser/tensorflow/tensorflow_ref_switch_parser.cc b/parser/tensorflow/tensorflow_ref_switch_parser.cc index aadd966..e7672eb 100644 --- a/parser/tensorflow/tensorflow_ref_switch_parser.cc +++ b/parser/tensorflow/tensorflow_ref_switch_parser.cc @@ -17,7 +17,7 @@ #include "parser/tensorflow/tensorflow_ref_switch_parser.h" #include "framework/common/debug/ge_log.h" #include "parser/common/op_def/ir_pb_converter.h" -#include "parser/common/op_def/ref_switch_op.h" +#include "parser/common/op_def/ref_switch_operator.h" #include "parser/common/op_parser_factory.h" #include "parser/common/util.h" diff --git a/parser/tensorflow/tensorflow_ref_switch_parser.h b/parser/tensorflow/tensorflow_ref_switch_parser.h index 52c059d..d048032 100644 --- a/parser/tensorflow/tensorflow_ref_switch_parser.h +++ b/parser/tensorflow/tensorflow_ref_switch_parser.h @@ -17,7 +17,7 @@ #ifndef DOMI_OMG_PARSER_OP_PARSER_TENSORFLOW_REF_SWITCH_H_ #define DOMI_OMG_PARSER_OP_PARSER_TENSORFLOW_REF_SWITCH_H_ -#include "common/op_def/ref_switch_op.h" +#include "common/op_def/ref_switch_operator.h" #include "parser/tensorflow/tensorflow_op_parser.h" namespace ge { diff --git a/parser/tensorflow/tensorflow_shape_n_parser.cc b/parser/tensorflow/tensorflow_shape_n_parser.cc index 3cb7fd1..16f1d1d 100644 --- a/parser/tensorflow/tensorflow_shape_n_parser.cc +++ b/parser/tensorflow/tensorflow_shape_n_parser.cc @@ -18,7 +18,7 @@ #include "parser/common/op_def/ir_pb_converter.h" #include "framework/common/debug/ge_log.h" #include "parser/common/op_parser_factory.h" -#include "parser/common/op_def/shape_n_op.h" +#include "parser/common/op_def/shape_n_operator.h" #include "parser/common/util.h" using domi::TENSORFLOW; diff --git a/parser/tensorflow/tensorflow_shape_n_parser.h b/parser/tensorflow/tensorflow_shape_n_parser.h index 9f92a93..475d191 100644 --- a/parser/tensorflow/tensorflow_shape_n_parser.h +++ b/parser/tensorflow/tensorflow_shape_n_parser.h @@ -17,7 +17,7 @@ #ifndef DOMI_OMG_PARSER_OP_PARSER_TENSORFLOW_SHAPE_N_H_ #define DOMI_OMG_PARSER_OP_PARSER_TENSORFLOW_SHAPE_N_H_ -#include "common/op_def/shape_n_op.h" +#include "common/op_def/shape_n_operator.h" #include "parser/tensorflow/tensorflow_op_parser.h" namespace ge { diff --git a/parser/tensorflow/tensorflow_var_is_initialized_op_parser.cc b/parser/tensorflow/tensorflow_var_is_initialized_op_parser.cc index 577bbca..b0fec3a 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 "parser/common/op_def/var_is_initialized_op_op.h" +#include "parser/common/op_def/var_is_initialized_op_operator.h" #include "parser/common/op_parser_factory.h" #include "parser/tensorflow/tensorflow_op_parser.h" #include "parser/tensorflow/tensorflow_parser_register.h" diff --git a/parser/tensorflow/tensorflow_variable_v2_parser.cc b/parser/tensorflow/tensorflow_variable_v2_parser.cc index 2b14280..ac850c7 100644 --- a/parser/tensorflow/tensorflow_variable_v2_parser.cc +++ b/parser/tensorflow/tensorflow_variable_v2_parser.cc @@ -21,7 +21,7 @@ #include "graph/op_desc.h" #include "graph/utils/attr_utils.h" #include "graph/utils/tensor_utils.h" -#include "parser/common/op_def/variable_op.h" +#include "parser/common/op_def/variable_operator.h" #include "parser/common/op_parser_factory.h" #include "parser/tensorflow/tensorflow_op_parser.h" #include "parser/tensorflow/tensorflow_parser_register.h" diff --git a/tests/st/CMakeLists.txt b/tests/st/CMakeLists.txt index 7498987..580669b 100644 --- a/tests/st/CMakeLists.txt +++ b/tests/st/CMakeLists.txt @@ -249,17 +249,17 @@ set(PARSER_SRC_FILES "${PARSER_DIR}/parser/common/convert/message2operator.cc" "${PARSER_DIR}/parser/common/data_op_parser.cc" "${PARSER_DIR}/parser/common/model_saver.cc" - "${PARSER_DIR}/parser/common/op_def/arg_op.cc" - "${PARSER_DIR}/parser/common/op_def/constant_op.cc" - "${PARSER_DIR}/parser/common/op_def/fill_op.cc" - "${PARSER_DIR}/parser/common/op_def/frameworkop_op.cc" + "${PARSER_DIR}/parser/common/op_def/arg_op_operator.cc" + "${PARSER_DIR}/parser/common/op_def/constant_operator.cc" + "${PARSER_DIR}/parser/common/op_def/fill_operator.cc" + "${PARSER_DIR}/parser/common/op_def/framework_op_operator.cc" "${PARSER_DIR}/parser/common/op_def/ir_pb_converter.cc" - "${PARSER_DIR}/parser/common/op_def/no_op_op.cc" + "${PARSER_DIR}/parser/common/op_def/no_op_operator.cc" "${PARSER_DIR}/parser/common/op_def/operator.cc" - "${PARSER_DIR}/parser/common/op_def/ref_switch_op.cc" - "${PARSER_DIR}/parser/common/op_def/shape_n_op.cc" - "${PARSER_DIR}/parser/common/op_def/variable_op.cc" - "${PARSER_DIR}/parser/common/op_def/var_is_initialized_op_op.cc" + "${PARSER_DIR}/parser/common/op_def/ref_switch_operator.cc" + "${PARSER_DIR}/parser/common/op_def/shape_n_operator.cc" + "${PARSER_DIR}/parser/common/op_def/variable_operator.cc" + "${PARSER_DIR}/parser/common/op_def/var_is_initialized_op_operator.cc" "${PARSER_DIR}/parser/common/op_map.cc" "${PARSER_DIR}/parser/common/op_parser_factory.cc" "${PARSER_DIR}/parser/common/parser_api.cc" @@ -284,8 +284,8 @@ set(PARSER_SRC_FILES "${PARSER_DIR}/parser/onnx/onnx_util.cc" "${PARSER_DIR}/parser/onnx/subgraph_adapter/if_subgraph_adapter.cc" "${PARSER_DIR}/parser/onnx/subgraph_adapter/subgraph_adapter_factory.cc" - "${PARSER_DIR}/parser/tensorflow/graph_functiondef.cc" - "${PARSER_DIR}/parser/tensorflow/graph_optimizer.cc" + "${PARSER_DIR}/parser/tensorflow/graph_to_function_def.cc" + "${PARSER_DIR}/parser/tensorflow/parser_graph_optimizer.cc" "${PARSER_DIR}/parser/tensorflow/iterator_fusion_pass.cc" "${PARSER_DIR}/parser/tensorflow/scope/scope_pass_manager.cc" "${PARSER_DIR}/parser/tensorflow/tensorflow_arg_parser.cc" diff --git a/tests/st/testcase/test_tensorflow_parser.cc b/tests/st/testcase/test_tensorflow_parser.cc index 06658f9..b5f1908 100644 --- a/tests/st/testcase/test_tensorflow_parser.cc +++ b/tests/st/testcase/test_tensorflow_parser.cc @@ -34,17 +34,17 @@ #include "external/parser/tensorflow_parser.h" #include "parser/tensorflow/tensorflow_constant_parser.h" #include "common/types.h" -#include "parser/common/op_def/variable_op.h" +#include "parser/common/op_def/variable_operator.h" #include "parser/tensorflow/tensorflow_ref_switch_parser.h" #include "parser/tensorflow/tensorflow_fusion_op_parser.h" #include "parser/tensorflow/tensorflow_auto_mapping_parser_adapter.h" -#include "parser/common/op_def/arg_op.h" +#include "parser/common/op_def/arg_op_operator.h" #include "parser/tensorflow/tensorflow_fusion_custom_parser_adapter.h" #include "parser/tensorflow/tensorflow_reshape_parser.h" #include "parser/tensorflow/tensorflow_custom_parser_adapter.h" #include "parser/tensorflow/tensorflow_squeeze_parser.h" -#include "parser/tensorflow/graph_functiondef.h" -#include "parser/tensorflow/graph_optimizer.h" +#include "parser/tensorflow/graph_to_function_def.h" +#include "parser/tensorflow/parser_graph_optimizer.h" #include "cce/dnn_base_def.hpp" #include "parser/tensorflow/scope/scope_pass_manager.h" #include "parser/tensorflow/tensorflow_util.h" @@ -52,10 +52,10 @@ #include "parser/tensorflow/tensorflow_enter_parser.h" #include "parser/common/op_def/ir_pb_converter.h" #include "parser/common/tuple.h" -#include "common/op_def/frameworkop_op.h" -#include "common/op_def/shape_n_op.h" -#include "common/op_def/var_is_initialized_op_op.h" -#include "common/op_def/fill_op.h" +#include "common/op_def/framework_op_operator.h" +#include "common/op_def/shape_n_operator.h" +#include "common/op_def/var_is_initialized_op_operator.h" +#include "common/op_def/fill_operator.h" #include "common/convert/pb2json.h" #include "common/convert/message2operator.h" #include "parser/common/proto_file_parser.h" @@ -70,7 +70,7 @@ #include "parser/common/prototype_pass_manager.h" #include "parser/common/register_tbe.h" #include "parser/common/pass_manager.h" -#include "parser/tensorflow/graph_optimizer.h" +#include "parser/tensorflow/parser_graph_optimizer.h" #include "metadef/inc/register/scope/scope_pass_registry_impl.h" #include "register/scope/scope_fusion_pass_register.h" #undef protected @@ -678,6 +678,7 @@ namespace { if ((_name== "S") || (_name == "K")) { int index = 0; + ge::AttrUtils::SetInt(opDef, "T", 1); ge::AttrUtils::SetInt(opDef, "arg_index", index); ge::AttrUtils::SetInt(opDef, "ret_index", index); diff --git a/tests/ut/parser/CMakeLists.txt b/tests/ut/parser/CMakeLists.txt index 0253c0f..28453d9 100644 --- a/tests/ut/parser/CMakeLists.txt +++ b/tests/ut/parser/CMakeLists.txt @@ -250,17 +250,17 @@ set(PARSER_SRC_FILES "${PARSER_DIR}/parser/common/convert/message2operator.cc" "${PARSER_DIR}/parser/common/data_op_parser.cc" "${PARSER_DIR}/parser/common/model_saver.cc" - "${PARSER_DIR}/parser/common/op_def/arg_op.cc" - "${PARSER_DIR}/parser/common/op_def/constant_op.cc" - "${PARSER_DIR}/parser/common/op_def/fill_op.cc" - "${PARSER_DIR}/parser/common/op_def/frameworkop_op.cc" + "${PARSER_DIR}/parser/common/op_def/arg_op_operator.cc" + "${PARSER_DIR}/parser/common/op_def/constant_operator.cc" + "${PARSER_DIR}/parser/common/op_def/fill_operator.cc" + "${PARSER_DIR}/parser/common/op_def/framework_op_operator.cc" "${PARSER_DIR}/parser/common/op_def/ir_pb_converter.cc" - "${PARSER_DIR}/parser/common/op_def/no_op_op.cc" + "${PARSER_DIR}/parser/common/op_def/no_op_operator.cc" "${PARSER_DIR}/parser/common/op_def/operator.cc" - "${PARSER_DIR}/parser/common/op_def/ref_switch_op.cc" - "${PARSER_DIR}/parser/common/op_def/shape_n_op.cc" - "${PARSER_DIR}/parser/common/op_def/variable_op.cc" - "${PARSER_DIR}/parser/common/op_def/var_is_initialized_op_op.cc" + "${PARSER_DIR}/parser/common/op_def/ref_switch_operator.cc" + "${PARSER_DIR}/parser/common/op_def/shape_n_operator.cc" + "${PARSER_DIR}/parser/common/op_def/variable_operator.cc" + "${PARSER_DIR}/parser/common/op_def/var_is_initialized_op_operator.cc" "${PARSER_DIR}/parser/common/op_map.cc" "${PARSER_DIR}/parser/common/op_parser_factory.cc" "${PARSER_DIR}/parser/common/parser_api.cc" @@ -285,8 +285,8 @@ set(PARSER_SRC_FILES "${PARSER_DIR}/parser/onnx/onnx_util.cc" "${PARSER_DIR}/parser/onnx/subgraph_adapter/if_subgraph_adapter.cc" "${PARSER_DIR}/parser/onnx/subgraph_adapter/subgraph_adapter_factory.cc" - "${PARSER_DIR}/parser/tensorflow/graph_functiondef.cc" - "${PARSER_DIR}/parser/tensorflow/graph_optimizer.cc" + "${PARSER_DIR}/parser/tensorflow/graph_to_function_def.cc" + "${PARSER_DIR}/parser/tensorflow/parser_graph_optimizer.cc" "${PARSER_DIR}/parser/tensorflow/iterator_fusion_pass.cc" "${PARSER_DIR}/parser/tensorflow/scope/scope_pass_manager.cc" "${PARSER_DIR}/parser/tensorflow/tensorflow_arg_parser.cc" diff --git a/tests/ut/parser/testcase/graph_optimizer_testcase/graph_optimizer_unittest.cc b/tests/ut/parser/testcase/graph_optimizer_testcase/graph_optimizer_unittest.cc index 5139002..9667978 100644 --- a/tests/ut/parser/testcase/graph_optimizer_testcase/graph_optimizer_unittest.cc +++ b/tests/ut/parser/testcase/graph_optimizer_testcase/graph_optimizer_unittest.cc @@ -7,7 +7,7 @@ #include "tensorflow/iterator_fusion_pass.h" #include "parser/common/acl_graph_parser_util.h" #define private public -#include "tensorflow/graph_optimizer.h" +#include "tensorflow/parser_graph_optimizer.h" #undef private namespace ge { class UtestGraphOptimizer : public testing::Test { diff --git a/tests/ut/parser/testcase/tensorflow_parser_testcase/tensorflow_parser_unittest.cc b/tests/ut/parser/testcase/tensorflow_parser_testcase/tensorflow_parser_unittest.cc index e3f6ea4..c852aad 100644 --- a/tests/ut/parser/testcase/tensorflow_parser_testcase/tensorflow_parser_unittest.cc +++ b/tests/ut/parser/testcase/tensorflow_parser_testcase/tensorflow_parser_unittest.cc @@ -38,17 +38,17 @@ #include "tests/depends/ops_stub/ops_stub.h" #include "parser/tensorflow/tensorflow_constant_parser.h" #include "common/types.h" -#include "parser/common/op_def/variable_op.h" +#include "parser/common/op_def/variable_operator.h" #include "parser/tensorflow/tensorflow_ref_switch_parser.h" #include "parser/tensorflow/tensorflow_fusion_op_parser.h" #include "parser/tensorflow/tensorflow_auto_mapping_parser_adapter.h" -#include "parser/common/op_def/arg_op.h" +#include "parser/common/op_def/arg_op_operator.h" #include "parser/tensorflow/tensorflow_fusion_custom_parser_adapter.h" #include "parser/tensorflow/tensorflow_reshape_parser.h" #include "parser/tensorflow/tensorflow_custom_parser_adapter.h" #include "parser/tensorflow/tensorflow_squeeze_parser.h" -#include "parser/tensorflow/graph_functiondef.h" -#include "parser/tensorflow/graph_optimizer.h" +#include "parser/tensorflow/graph_to_function_def.h" +#include "parser/tensorflow/parser_graph_optimizer.h" #include "cce/dnn_base_def.hpp" #include "parser/tensorflow/scope/scope_pass_manager.h" #include "parser/tensorflow/tensorflow_util.h" @@ -56,10 +56,10 @@ #include "parser/tensorflow/tensorflow_enter_parser.h" #include "parser/common/op_def/ir_pb_converter.h" #include "parser/common/tuple.h" -#include "common/op_def/frameworkop_op.h" -#include "common/op_def/shape_n_op.h" -#include "common/op_def/var_is_initialized_op_op.h" -#include "common/op_def/fill_op.h" +#include "common/op_def/framework_op_operator.h" +#include "common/op_def/shape_n_operator.h" +#include "common/op_def/var_is_initialized_op_operator.h" +#include "common/op_def/fill_operator.h" #include "common/convert/pb2json.h" #include "common/convert/message2operator.h" #include "parser/common/proto_file_parser.h" @@ -73,7 +73,7 @@ #include "parser/common/prototype_pass_manager.h" #include "parser/common/register_tbe.h" #include "parser/common/pass_manager.h" -#include "parser/tensorflow/graph_optimizer.h" +#include "parser/tensorflow/parser_graph_optimizer.h" #include "metadef/inc/register/scope/scope_pass_registry_impl.h" #include "register/scope/scope_fusion_pass_register.h" #include "common/op_map.h"