From 988363299f1fe0683121e6d64bb6326089f65f36 Mon Sep 17 00:00:00 2001 From: w00517616 Date: Tue, 14 Apr 2020 15:35:30 +0800 Subject: [PATCH] Exclude FV to further improve performance. --- mindspore/ccsrc/pipeline/static_analysis/evaluator.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/pipeline/static_analysis/evaluator.cc b/mindspore/ccsrc/pipeline/static_analysis/evaluator.cc index 99cb893104..5bad1634d5 100644 --- a/mindspore/ccsrc/pipeline/static_analysis/evaluator.cc +++ b/mindspore/ccsrc/pipeline/static_analysis/evaluator.cc @@ -63,6 +63,9 @@ AnalysisContextPtr BaseFuncGraphEvaluator::MakeContext(const AnalysisEnginePtr & } static std::vector FastShadowSort(const AnfNodePtr &ret_node) { + auto ori_func_graph = ret_node->func_graph(); + MS_EXCEPTION_IF_NULL(ori_func_graph); + std::vector sorted_nodes; std::unordered_set checked_cnodes; std::size_t index = 0; @@ -75,7 +78,8 @@ static std::vector FastShadowSort(const AnfNodePtr &ret_node) { auto &inputs = current->cast()->inputs(); for (auto it = inputs.begin(); it != inputs.end(); it++) { AnfNodePtr input = *it; - if (input != nullptr && input->isa() && checked_cnodes.find(input) == checked_cnodes.end()) { + if (input != nullptr && input->isa() && checked_cnodes.find(input) == checked_cnodes.end() && + input->func_graph() == ori_func_graph) { sorted_nodes.emplace_back(input); (void)checked_cnodes.insert(input); }