Browse Source

!640 clean code

Merge pull request !640 from xuyf/ge_dev
pull/647/MERGE
xuyf i-robot 2 years ago
parent
commit
98d65d1ebc
55 changed files with 132 additions and 131 deletions
  1. +11
    -11
      parser/CMakeLists.txt
  2. +1
    -1
      parser/common/convert/message2operator.cc
  3. +1
    -1
      parser/common/convert/message2operator.h
  4. +4
    -6
      parser/common/convert/pb2json.cc
  5. +1
    -1
      parser/common/convert/pb2json.h
  6. +2
    -2
      parser/common/op_def/arg_op_operator.cc
  7. +1
    -1
      parser/common/op_def/arg_op_operator.h
  8. +2
    -2
      parser/common/op_def/constant_operator.cc
  9. +1
    -1
      parser/common/op_def/constant_operator.h
  10. +2
    -2
      parser/common/op_def/fill_operator.cc
  11. +1
    -1
      parser/common/op_def/fill_operator.h
  12. +2
    -2
      parser/common/op_def/framework_op_operator.cc
  13. +1
    -1
      parser/common/op_def/framework_op_operator.h
  14. +1
    -1
      parser/common/op_def/ir_pb_converter.cc
  15. +1
    -1
      parser/common/op_def/ir_pb_converter.h
  16. +2
    -2
      parser/common/op_def/no_op_operator.cc
  17. +1
    -2
      parser/common/op_def/no_op_operator.h
  18. +1
    -1
      parser/common/op_def/operator.cc
  19. +1
    -1
      parser/common/op_def/operator.h
  20. +2
    -2
      parser/common/op_def/ref_switch_operator.cc
  21. +1
    -1
      parser/common/op_def/ref_switch_operator.h
  22. +2
    -2
      parser/common/op_def/shape_n_operator.cc
  23. +1
    -1
      parser/common/op_def/shape_n_operator.h
  24. +2
    -2
      parser/common/op_def/var_is_initialized_op_operator.cc
  25. +1
    -1
      parser/common/op_def/var_is_initialized_op_operator.h
  26. +2
    -2
      parser/common/op_def/variable_operator.cc
  27. +1
    -1
      parser/common/op_def/variable_operator.h
  28. +11
    -11
      parser/module.mk
  29. +2
    -2
      parser/tensorflow/graph_to_function_def.cc
  30. +1
    -1
      parser/tensorflow/graph_to_function_def.h
  31. +2
    -2
      parser/tensorflow/iterator_fusion_pass.cc
  32. +1
    -1
      parser/tensorflow/iterator_fusion_pass.h
  33. +6
    -3
      parser/tensorflow/parser_graph_optimizer.cc
  34. +1
    -1
      parser/tensorflow/parser_graph_optimizer.h
  35. +1
    -1
      parser/tensorflow/scope/scope_pass_manager.cc
  36. +1
    -1
      parser/tensorflow/scope/scope_pass_manager.h
  37. +2
    -2
      parser/tensorflow/tensorflow_arg_parser.cc
  38. +1
    -1
      parser/tensorflow/tensorflow_auto_mapping_parser_adapter.cc
  39. +1
    -1
      parser/tensorflow/tensorflow_auto_mapping_parser_adapter.h
  40. +1
    -1
      parser/tensorflow/tensorflow_constant_parser.cc
  41. +1
    -1
      parser/tensorflow/tensorflow_constant_parser.h
  42. +1
    -1
      parser/tensorflow/tensorflow_fill_parser.cc
  43. +1
    -1
      parser/tensorflow/tensorflow_frameworkop_parser.cc
  44. +1
    -1
      parser/tensorflow/tensorflow_no_op_parser.cc
  45. +1
    -1
      parser/tensorflow/tensorflow_ref_switch_parser.cc
  46. +1
    -1
      parser/tensorflow/tensorflow_ref_switch_parser.h
  47. +1
    -1
      parser/tensorflow/tensorflow_shape_n_parser.cc
  48. +1
    -1
      parser/tensorflow/tensorflow_shape_n_parser.h
  49. +1
    -1
      parser/tensorflow/tensorflow_var_is_initialized_op_parser.cc
  50. +1
    -1
      parser/tensorflow/tensorflow_variable_v2_parser.cc
  51. +11
    -11
      tests/st/CMakeLists.txt
  52. +10
    -9
      tests/st/testcase/test_tensorflow_parser.cc
  53. +11
    -11
      tests/ut/parser/CMakeLists.txt
  54. +1
    -1
      tests/ut/parser/testcase/graph_optimizer_testcase/graph_optimizer_unittest.cc
  55. +9
    -9
      tests/ut/parser/testcase/tensorflow_parser_testcase/tensorflow_parser_unittest.cc

+ 11
- 11
parser/CMakeLists.txt View File

@@ -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 ############


+ 1
- 1
parser/common/convert/message2operator.cc View File

@@ -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.


+ 1
- 1
parser/common/convert/message2operator.h View File

@@ -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.


+ 4
- 6
parser/common/convert/pb2json.cc View File

@@ -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<uint8_t *>(&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;
}


+ 1
- 1
parser/common/convert/pb2json.h View File

@@ -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.


parser/common/op_def/arg_op.cc → parser/common/op_def/arg_op_operator.cc View File

@@ -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 <string>
#include "framework/common/fmk_types.h"


parser/common/op_def/arg_op.h → parser/common/op_def/arg_op_operator.h View File

@@ -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.

parser/common/op_def/constant_op.cc → parser/common/op_def/constant_operator.cc View File

@@ -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 <string>
#include <vector>


parser/common/op_def/constant_op.h → parser/common/op_def/constant_operator.h View File

@@ -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.

parser/common/op_def/fill_op.cc → parser/common/op_def/fill_operator.cc View File

@@ -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 {

parser/common/op_def/fill_op.h → parser/common/op_def/fill_operator.h View File

@@ -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.

parser/common/op_def/frameworkop_op.cc → parser/common/op_def/framework_op_operator.cc View File

@@ -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 <string>
#include "framework/common/fmk_types.h"


parser/common/op_def/frameworkop_op.h → parser/common/op_def/framework_op_operator.h View File

@@ -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.

+ 1
- 1
parser/common/op_def/ir_pb_converter.cc View File

@@ -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.


+ 1
- 1
parser/common/op_def/ir_pb_converter.h View File

@@ -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.


parser/common/op_def/no_op_op.cc → parser/common/op_def/no_op_operator.cc View File

@@ -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 <string>

namespace ge {

parser/common/op_def/no_op_op.h → parser/common/op_def/no_op_operator.h View File

@@ -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 {

+ 1
- 1
parser/common/op_def/operator.cc View File

@@ -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.


+ 1
- 1
parser/common/op_def/operator.h View File

@@ -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.


parser/common/op_def/ref_switch_op.cc → parser/common/op_def/ref_switch_operator.cc View File

@@ -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") {}

parser/common/op_def/ref_switch_op.h → parser/common/op_def/ref_switch_operator.h View File

@@ -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.

parser/common/op_def/shape_n_op.cc → parser/common/op_def/shape_n_operator.cc View File

@@ -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"


parser/common/op_def/shape_n_op.h → parser/common/op_def/shape_n_operator.h View File

@@ -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.

parser/common/op_def/var_is_initialized_op_op.cc → parser/common/op_def/var_is_initialized_op_operator.cc View File

@@ -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 <string>
#include <vector>


parser/common/op_def/var_is_initialized_op_op.h → parser/common/op_def/var_is_initialized_op_operator.h View File

@@ -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.

parser/common/op_def/variable_op.cc → parser/common/op_def/variable_operator.cc View File

@@ -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"


parser/common/op_def/variable_op.h → parser/common/op_def/variable_operator.h View File

@@ -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.

+ 11
- 11
parser/module.mk View File

@@ -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)


parser/tensorflow/graph_functiondef.cc → parser/tensorflow/graph_to_function_def.cc View File

@@ -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 <iostream>
#include "common/fmk_error_codes.h"
#include "graph/debug/ge_attr_define.h"

parser/tensorflow/graph_functiondef.h → parser/tensorflow/graph_to_function_def.h View File

@@ -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.

+ 2
- 2
parser/tensorflow/iterator_fusion_pass.cc View File

@@ -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 {


+ 1
- 1
parser/tensorflow/iterator_fusion_pass.h View File

@@ -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.


parser/tensorflow/graph_optimizer.cc → parser/tensorflow/parser_graph_optimizer.cc View File

@@ -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<ge::NodePtr> &nodes, FunctionDefLibrary *library)

Status ParserGraphOptimizer::UpdateGraph(vector<NodePtr> &nodes) {
ComputeGraphPtr sub_graph = nullptr;
GE_MAKE_SHARED(sub_graph = std::make_shared<ComputeGraph>("subGraph"), sub_graph = nullptr; return PARAM_INVALID);
GE_MAKE_SHARED(
sub_graph = std::make_shared<ComputeGraph>("subGraph"),
sub_graph = nullptr;
return PARAM_INVALID);

unordered_map<string, NodePtr> node_map;
vector<InDataAnchorPtr> input_anchors;

parser/tensorflow/graph_optimizer.h → parser/tensorflow/parser_graph_optimizer.h View File

@@ -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.

+ 1
- 1
parser/tensorflow/scope/scope_pass_manager.cc View File

@@ -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.


+ 1
- 1
parser/tensorflow/scope/scope_pass_manager.h View File

@@ -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.


+ 2
- 2
parser/tensorflow/tensorflow_arg_parser.cc View File

@@ -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"


+ 1
- 1
parser/tensorflow/tensorflow_auto_mapping_parser_adapter.cc View File

@@ -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.


+ 1
- 1
parser/tensorflow/tensorflow_auto_mapping_parser_adapter.h View File

@@ -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.


+ 1
- 1
parser/tensorflow/tensorflow_constant_parser.cc View File

@@ -19,7 +19,7 @@
#include <memory>
#include <vector>
#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"


+ 1
- 1
parser/tensorflow/tensorflow_constant_parser.h View File

@@ -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"



+ 1
- 1
parser/tensorflow/tensorflow_fill_parser.cc View File

@@ -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"



+ 1
- 1
parser/tensorflow/tensorflow_frameworkop_parser.cc View File

@@ -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"


+ 1
- 1
parser/tensorflow/tensorflow_no_op_parser.cc View File

@@ -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;


+ 1
- 1
parser/tensorflow/tensorflow_ref_switch_parser.cc View File

@@ -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"



+ 1
- 1
parser/tensorflow/tensorflow_ref_switch_parser.h View File

@@ -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 {


+ 1
- 1
parser/tensorflow/tensorflow_shape_n_parser.cc View File

@@ -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;


+ 1
- 1
parser/tensorflow/tensorflow_shape_n_parser.h View File

@@ -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 {


+ 1
- 1
parser/tensorflow/tensorflow_var_is_initialized_op_parser.cc View File

@@ -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"


+ 1
- 1
parser/tensorflow/tensorflow_variable_v2_parser.cc View File

@@ -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"


+ 11
- 11
tests/st/CMakeLists.txt View File

@@ -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"


+ 10
- 9
tests/st/testcase/test_tensorflow_parser.cc View File

@@ -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);


+ 11
- 11
tests/ut/parser/CMakeLists.txt View File

@@ -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"


+ 1
- 1
tests/ut/parser/testcase/graph_optimizer_testcase/graph_optimizer_unittest.cc View File

@@ -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 {


+ 9
- 9
tests/ut/parser/testcase/tensorflow_parser_testcase/tensorflow_parser_unittest.cc View File

@@ -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"


Loading…
Cancel
Save