diff --git a/parser/onnx/onnx_parser.cc b/parser/onnx/onnx_parser.cc index bd92de9..976dbcc 100644 --- a/parser/onnx/onnx_parser.cc +++ b/parser/onnx/onnx_parser.cc @@ -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. diff --git a/parser/onnx/onnx_parser.h b/parser/onnx/onnx_parser.h index 586d925..90b7397 100644 --- a/parser/onnx/onnx_parser.h +++ b/parser/onnx/onnx_parser.h @@ -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. diff --git a/parser/onnx/onnx_util.cc b/parser/onnx/onnx_util.cc index fa84174..f41b7c6 100644 --- a/parser/onnx/onnx_util.cc +++ b/parser/onnx/onnx_util.cc @@ -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. diff --git a/parser/onnx/onnx_util.h b/parser/onnx/onnx_util.h index cdb61b6..7cecd26 100644 --- a/parser/onnx/onnx_util.h +++ b/parser/onnx/onnx_util.h @@ -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. diff --git a/parser/onnx/subgraph_adapter/if_subgraph_adapter.cc b/parser/onnx/subgraph_adapter/if_subgraph_adapter.cc index bcf01d8..02d9e16 100644 --- a/parser/onnx/subgraph_adapter/if_subgraph_adapter.cc +++ b/parser/onnx/subgraph_adapter/if_subgraph_adapter.cc @@ -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. diff --git a/parser/onnx/subgraph_adapter/if_subgraph_adapter.h b/parser/onnx/subgraph_adapter/if_subgraph_adapter.h index 936b9fd..6c15ecc 100644 --- a/parser/onnx/subgraph_adapter/if_subgraph_adapter.h +++ b/parser/onnx/subgraph_adapter/if_subgraph_adapter.h @@ -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. diff --git a/parser/onnx/subgraph_adapter/subgraph_adapter.h b/parser/onnx/subgraph_adapter/subgraph_adapter.h index be84ee4..7123bd3 100644 --- a/parser/onnx/subgraph_adapter/subgraph_adapter.h +++ b/parser/onnx/subgraph_adapter/subgraph_adapter.h @@ -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. diff --git a/parser/onnx/subgraph_adapter/subgraph_adapter_factory.cc b/parser/onnx/subgraph_adapter/subgraph_adapter_factory.cc index b8bf478..ce4399d 100644 --- a/parser/onnx/subgraph_adapter/subgraph_adapter_factory.cc +++ b/parser/onnx/subgraph_adapter/subgraph_adapter_factory.cc @@ -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. diff --git a/parser/onnx/subgraph_adapter/subgraph_adapter_factory.h b/parser/onnx/subgraph_adapter/subgraph_adapter_factory.h index debe623..af01fc4 100644 --- a/parser/onnx/subgraph_adapter/subgraph_adapter_factory.h +++ b/parser/onnx/subgraph_adapter/subgraph_adapter_factory.h @@ -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 #include #include @@ -106,10 +92,9 @@ public: */ #define REGISTER_SUBGRAPH_ADAPTER_CREATOR(op_type, clazz) \ std::shared_ptr Creator_##op_type##_Subgraph_Adapter() { \ - std::shared_ptr ptr(new (std::nothrow) clazz()); \ - if (ptr == nullptr) { \ - GELOGW("MakeShared failed, result is nullptr."); \ - } \ + std::shared_ptr ptr = nullptr; \ + GE_MAKE_SHARED(ptr = std::make_shared(), \ + ptr = nullptr); \ return std::shared_ptr(ptr); \ } \ ge::SubgraphAdapterRegisterar g_##op_type##_Subgraph_Adapter_Creator(op_type, \ diff --git a/parser/tensorflow/graph_to_function_def.cc b/parser/tensorflow/graph_to_function_def.cc index 9629cfc..ea7e1cd 100644 --- a/parser/tensorflow/graph_to_function_def.cc +++ b/parser/tensorflow/graph_to_function_def.cc @@ -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::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::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()); diff --git a/parser/tensorflow/parser_graph_optimizer.cc b/parser/tensorflow/parser_graph_optimizer.cc index 9046292..532314f 100644 --- a/parser/tensorflow/parser_graph_optimizer.cc +++ b/parser/tensorflow/parser_graph_optimizer.cc @@ -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 & const std::map::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find(static_cast(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 &in const std::map::const_iterator iter = GE_TENSORFLOW_DATA_TYPE_MAP.find(static_cast(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());