Browse Source

!691 sync parser to master 20220928

Merge pull request !691 from zhangfan/ge_dev
pull/701/MERGE
zhangfan Gitee 2 years ago
parent
commit
f612123e71
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
11 changed files with 17 additions and 32 deletions
  1. +1
    -1
      parser/onnx/onnx_parser.cc
  2. +1
    -1
      parser/onnx/onnx_parser.h
  3. +1
    -1
      parser/onnx/onnx_util.cc
  4. +1
    -1
      parser/onnx/onnx_util.h
  5. +1
    -1
      parser/onnx/subgraph_adapter/if_subgraph_adapter.cc
  6. +1
    -1
      parser/onnx/subgraph_adapter/if_subgraph_adapter.h
  7. +1
    -1
      parser/onnx/subgraph_adapter/subgraph_adapter.h
  8. +1
    -1
      parser/onnx/subgraph_adapter/subgraph_adapter_factory.cc
  9. +4
    -19
      parser/onnx/subgraph_adapter/subgraph_adapter_factory.h
  10. +2
    -2
      parser/tensorflow/graph_to_function_def.cc
  11. +3
    -3
      parser/tensorflow/parser_graph_optimizer.cc

+ 1
- 1
parser/onnx/onnx_parser.cc View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved.
* 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/onnx/onnx_parser.h View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved.
* 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/onnx/onnx_util.cc View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved.
* 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/onnx/onnx_util.h View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved.
* 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/onnx/subgraph_adapter/if_subgraph_adapter.cc View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved.
* 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/onnx/subgraph_adapter/if_subgraph_adapter.h View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved.
* 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/onnx/subgraph_adapter/subgraph_adapter.h View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved.
* 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/onnx/subgraph_adapter/subgraph_adapter_factory.cc View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved.
* 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
- 19
parser/onnx/subgraph_adapter/subgraph_adapter_factory.h View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Huawei Technologies Co., Ltd. 2020~2022. All rights reserved.
* 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.
@@ -17,20 +17,6 @@
#ifndef GE_PARSER_ONNX_SUBGRAPH_ADAPTER_SUBGRAPH_ADAPTER_FACTORY_H_
#define GE_PARSER_ONNX_SUBGRAPH_ADAPTER_SUBGRAPH_ADAPTER_FACTORY_H_

#if defined(_MSC_VER)
#ifdef FUNC_VISIBILITY
#define PARSER_FUNC_VISIBILITY _declspec(dllexport)
#else
#define PARSER_FUNC_VISIBILITY
#endif
#else
#ifdef FUNC_VISIBILITY
#define PARSER_FUNC_VISIBILITY __attribute__((visibility("default")))
#else
#define PARSER_FUNC_VISIBILITY
#endif
#endif

#include <map>
#include <memory>
#include <functional>
@@ -106,10 +92,9 @@ public:
*/
#define REGISTER_SUBGRAPH_ADAPTER_CREATOR(op_type, clazz) \
std::shared_ptr<SubgraphAdapter> Creator_##op_type##_Subgraph_Adapter() { \
std::shared_ptr<clazz> ptr(new (std::nothrow) clazz()); \
if (ptr == nullptr) { \
GELOGW("MakeShared failed, result is nullptr."); \
} \
std::shared_ptr<clazz> ptr = nullptr; \
GE_MAKE_SHARED(ptr = std::make_shared<clazz>(), \
ptr = nullptr); \
return std::shared_ptr<SubgraphAdapter>(ptr); \
} \
ge::SubgraphAdapterRegisterar g_##op_type##_Subgraph_Adapter_Creator(op_type, \


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

@@ -223,7 +223,7 @@ domi::Status GraphToFunctionDef::RecordResult(ge::ComputeGraphPtr graph,
GE_CHECK_NOTNULL(anchor->GetOwnerNode()->GetOpDesc());
int32_t type = anchor->GetOwnerNode()->GetOpDesc()->GetOutputDesc(anchor->GetIdx()).GetDataType();
std::map<int32_t, int32_t>::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find(type);
GE_IF_BOOL_EXEC(iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(),
GE_IF_BOOL_EXEC(iter == GE_TENSORFLOW_DATA_TYPE_MAP.cend(),
REPORT_INNER_ERROR("E19999", "datatype:%d of output:%d in node:%s:%s is not supported",
type, anchor->GetIdx(), anchor->GetOwnerNode()->GetName().c_str(),
anchor->GetOwnerNode()->GetName().c_str());
@@ -300,7 +300,7 @@ domi::Status GraphToFunctionDef::RecordArg(ge::ComputeGraphPtr graph, const vect

int32_t type = tensor_desc_ptr->GetDataType();
std::map<int32_t, int32_t>::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find(type);
GE_IF_BOOL_EXEC(iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(),
GE_IF_BOOL_EXEC(iter == GE_TENSORFLOW_DATA_TYPE_MAP.cend(),
REPORT_INNER_ERROR("E19999", "datatype:%d of input:%d in node:%s:%s is not supported",
type, anchor->GetIdx(), anchor->GetOwnerNode()->GetName().c_str(),
anchor->GetOwnerNode()->GetName().c_str());


+ 3
- 3
parser/tensorflow/parser_graph_optimizer.cc View File

@@ -1,5 +1,5 @@
/**
* Copyright 2020-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.
@@ -394,7 +394,7 @@ Status ParserGraphOptimizer::RebuildOutputAnchors(vector<ge::OutDataAnchorPtr> &
const std::map<int32_t, int32_t>::const_iterator iter =
GE_TENSORFLOW_DATA_TYPE_MAP.find(static_cast<int32_t>(data_type));
GE_IF_BOOL_EXEC(
iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(),
iter == GE_TENSORFLOW_DATA_TYPE_MAP.cend(),
REPORT_INNER_ERROR("E19999", "datatype:%d of output:%d in node:%s:%s is not supported",
data_type, out_anchor->GetIdx(), src_node->GetName().c_str(), src_node->GetName().c_str());
GELOGE(PARAM_INVALID, "data_type %s not supported", ge::TypeUtils::DataTypeToSerialString(data_type).c_str());
@@ -431,7 +431,7 @@ Status ParserGraphOptimizer::RebuildInputAnchors(vector<ge::InDataAnchorPtr> &in
const std::map<int32_t, int32_t>::const_iterator iter =
GE_TENSORFLOW_DATA_TYPE_MAP.find(static_cast<int32_t>(data_type));
GE_IF_BOOL_EXEC(
iter == GE_TENSORFLOW_DATA_TYPE_MAP.end(),
iter == GE_TENSORFLOW_DATA_TYPE_MAP.cend(),
REPORT_INNER_ERROR("E19999", "datatype:%d of input:%d in node:%s:%s is not supported",
data_type, in_anchor->GetIdx(), dst_node->GetName().c_str(), dst_node->GetName().c_str());
GELOGE(PARAM_INVALID, "data_type %s not supported", ge::TypeUtils::DataTypeToSerialString(data_type).c_str());


Loading…
Cancel
Save