From 348bdf43525aa66ac80aa8b8abbae6d845e6b21c Mon Sep 17 00:00:00 2001 From: Zhang Qinghua Date: Tue, 22 Dec 2020 19:33:46 +0800 Subject: [PATCH] Use the local deque as reference in lambda. --- mindspore/core/ir/graph_utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/core/ir/graph_utils.cc b/mindspore/core/ir/graph_utils.cc index fb61a1db406..b0dc47bc2b7 100644 --- a/mindspore/core/ir/graph_utils.cc +++ b/mindspore/core/ir/graph_utils.cc @@ -61,7 +61,7 @@ std::vector TopoSort(const AnfNodePtr &root, const SuccFunc &succ, c node->seen_ = seen; if (incl == FOLLOW) { auto succs = succ(node); - (void)std::copy_if(succs.begin(), succs.end(), std::back_inserter(todo), [seen, todo](const AnfNodePtr &next) { + (void)std::copy_if(succs.begin(), succs.end(), std::back_inserter(todo), [seen, &todo](const AnfNodePtr &next) { if (next == nullptr || next->extra_seen_ == seen) { return false; }