From eccff67f421da4ae147c629f61821676acf550d2 Mon Sep 17 00:00:00 2001 From: zhangxiaokun Date: Sat, 26 Jun 2021 15:42:55 +0800 Subject: [PATCH] Clear UpdatePersistTensor Warning for first run --- ge/graph/passes/mark_force_unknown_for_cond_pass.cc | 6 +++--- ge/graph/passes/mark_force_unknown_for_cond_pass.h | 2 +- ge/hybrid/executor/node_state.cc | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ge/graph/passes/mark_force_unknown_for_cond_pass.cc b/ge/graph/passes/mark_force_unknown_for_cond_pass.cc index 233a1ff0..aa36a43b 100644 --- a/ge/graph/passes/mark_force_unknown_for_cond_pass.cc +++ b/ge/graph/passes/mark_force_unknown_for_cond_pass.cc @@ -56,8 +56,8 @@ Status MarkForceUnknownForCondPass::Run(ComputeGraphPtr graph) { /// @param [out] Search queue /// @return true: Switch In while loop / false: Not in while Loop. /// -bool MarkForceUnknownForCondPass::DealWithLoopSwitch(const NodePtr &node, uint32_t dst_span, - std::queue> search_queue) { +bool MarkForceUnknownForCondPass::DealAsLoopSwitch(const NodePtr &node, uint32_t dst_span, + std::queue> &search_queue) { /// LoopCond --->\. /// \. /// Enter-----------+ \. @@ -121,7 +121,7 @@ void MarkForceUnknownForCondPass::MarkUnknownForSwitch(const NodePtr &node, std: GELOGD("Travel node: %s, %s node: %s, span is: %u", dst_node->GetName().c_str(), node_type.c_str(), in_node->GetName().c_str(), dst_span); if (kSwitchOpTypes.count(node_type) > 0) { // Switch input node. - if (DealWithLoopSwitch(in_node, dst_span, search_queue)) { + if (DealAsLoopSwitch(in_node, dst_span, search_queue)) { continue; } diff --git a/ge/graph/passes/mark_force_unknown_for_cond_pass.h b/ge/graph/passes/mark_force_unknown_for_cond_pass.h index d2be9a9e..030b55ee 100644 --- a/ge/graph/passes/mark_force_unknown_for_cond_pass.h +++ b/ge/graph/passes/mark_force_unknown_for_cond_pass.h @@ -34,7 +34,7 @@ class MarkForceUnknownForCondPass : public GraphPass { /// @param [out] Search queue /// @return true: Switch In while loop / false: Not in while Loop. /// - bool DealWithLoopSwitch(const NodePtr &node, uint32_t dst_span, std::queue> search_queue); + bool DealAsLoopSwitch(const NodePtr &node, uint32_t dst_span, std::queue> &search_queue); /// /// @brief Mark force unknown shape for Switch node diff --git a/ge/hybrid/executor/node_state.cc b/ge/hybrid/executor/node_state.cc index 7ab7b536..ad38c792 100644 --- a/ge/hybrid/executor/node_state.cc +++ b/ge/hybrid/executor/node_state.cc @@ -355,6 +355,10 @@ void NodeState::UpdatePersistTensor() { } }; + if (root_tensor_values_.empty()) { + return; + } + update_tensor(node_item_->root_data_); if (iteration_count_ > 0) { update_tensor(node_item_->enter_data_);