From 7b6566c0318b4562dad552da1f61ff3705f40a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=B3=E9=BE=99=E9=94=8B?= Date: Thu, 26 Sep 2024 20:09:33 +0800 Subject: [PATCH] update warn --- .../optimizers/om_partition_subgraphs_pass.cc | 20 +++++++++---------- tf_adapter/util/ge_plugin.cc | 8 ++++---- tf_adapter/util/generate_report.cc | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tf_adapter/optimizers/om_partition_subgraphs_pass.cc b/tf_adapter/optimizers/om_partition_subgraphs_pass.cc index eef34c856..3eced9e72 100644 --- a/tf_adapter/optimizers/om_partition_subgraphs_pass.cc +++ b/tf_adapter/optimizers/om_partition_subgraphs_pass.cc @@ -412,7 +412,7 @@ int FindNodesInPaths(Node *op_head, const NodeSet &ops_tail, NodeSet &ops_save) continue; } - for (auto out_node : cur_node->out_nodes()) { + for (auto cur_out_node : cur_node->out_nodes()) { auto num_outputs = [](const Node *node) { unsigned int n = 0; for (auto out_node : node->out_nodes()) { @@ -422,18 +422,18 @@ int FindNodesInPaths(Node *op_head, const NodeSet &ops_tail, NodeSet &ops_save) } return n; }; - if (ops_save.count(out_node) > 0) { + if (ops_save.count(cur_out_node) > 0) { for (auto node : path) { (void) ops_save.insert(node); } } - auto outputs_size = num_outputs(out_node); - if (seen.emplace(NodeMap::value_type(out_node, empty)).second || - seen[out_node].size() < outputs_size) { - stack.push_back(out_node); + auto outputs_size = num_outputs(cur_out_node); + if (seen.emplace(NodeMap::value_type(cur_out_node, empty)).second || + seen[cur_out_node].size() < outputs_size) { + stack.push_back(cur_out_node); } - if (seen[out_node].size() >= outputs_size) { - (void) noagain.insert(out_node); + if (seen[cur_out_node].size() >= outputs_size) { + (void) noagain.insert(cur_out_node); } } } @@ -1202,8 +1202,8 @@ Status MarkForPartition(const std::unique_ptr *graph_in, int &clusterNum, // A node/slot pair. struct NodeSlot { NodeSlot() : node(nullptr), slot(-1), dtype(DT_INVALID) {} - NodeSlot(const Node *node, int slot) : node(node), slot(slot), dtype(DT_INVALID) {} - NodeSlot(const Node *node, int slot, DataType dtype) : node(node), slot(slot), dtype(dtype) {} + NodeSlot(const Node *node_arg, int slot_arg) : node(node_arg), slot(slot_arg), dtype(DT_INVALID) {} + NodeSlot(const Node *node_arg, int slot_arg, DataType dtype_arg) : node(node_arg), slot(slot_arg), dtype(dtype_arg) {} const Node *node; int slot; diff --git a/tf_adapter/util/ge_plugin.cc b/tf_adapter/util/ge_plugin.cc index a336c81c4..f83e08591 100644 --- a/tf_adapter/util/ge_plugin.cc +++ b/tf_adapter/util/ge_plugin.cc @@ -327,9 +327,9 @@ void GePlugin::Init(std::map &init_options, const bool std::launch::async, [this](const std::map &init_options) -> ge::Status { const auto init_ascend_string_options = ChangeStringToAscendString(init_options); - const auto ret = ge::GEInitialize(init_ascend_string_options); + const auto init_ret = ge::GEInitialize(init_ascend_string_options); error_message_ = std::string(ge::GEGetErrorMsgV2().GetString()); - return ret; + return init_ret; }, init_options) .share(); @@ -445,8 +445,8 @@ void GePlugin::Finalize() { } if (!kIsHeterogeneous && tdt_init) { ADP_LOG(INFO) << "[GePlugin] Close TsdClient and destroy tdt."; - int32_t ret = tdt::TdtOutFeedDestroy(); - if (ret != 0) { + int32_t tdt_ret = tdt::TdtOutFeedDestroy(); + if (tdt_ret != 0) { LOG(ERROR) << "[GePlugin] Close tdt host failed."; ADP_LOG(ERROR) << "[GePlugin] Close tdt host failed."; } diff --git a/tf_adapter/util/generate_report.cc b/tf_adapter/util/generate_report.cc index 09eed2f97..41ab864f5 100644 --- a/tf_adapter/util/generate_report.cc +++ b/tf_adapter/util/generate_report.cc @@ -84,7 +84,7 @@ Status GenerateReport::SaveUnsupportedInfo() { {kKeyReason, reason}}; graph_info[kKeyOp].push_back(op); } - info_str = graph_info.dump(static_cast(kInterval), ' ', false, Json::error_handler_t::ignore); + info_str = graph_info.dump(static_cast(kInterval), ' ', false, Json::error_handler_t::ignore); } catch (std::exception &e) { return errors::Internal("Failed to convert json to string ,reason:", e.what()); } catch (...) { -- Gitee