From 591ad33e32a3528b9def15ef8c707b6a2be10334 Mon Sep 17 00:00:00 2001 From: dzhwinter Date: Mon, 18 Feb 2019 12:14:09 +0800 Subject: [PATCH] polish code for reading. test=develop --- paddle/fluid/framework/details/memory_optimize_pass.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/details/memory_optimize_pass.cc b/paddle/fluid/framework/details/memory_optimize_pass.cc index fabcd2ecd2b..aa6641d3f26 100644 --- a/paddle/fluid/framework/details/memory_optimize_pass.cc +++ b/paddle/fluid/framework/details/memory_optimize_pass.cc @@ -46,6 +46,7 @@ namespace details { std::unique_ptr MemoryOptimizePass::ApplyImpl( std::unique_ptr graph) const { auto nodes = graph->Nodes(); + ClearControlDepVars(graph.get()); CollectSkipVarsSet(nodes); cfg_.reset(new details::ControlFlowGraph(*graph)); @@ -128,7 +129,7 @@ std::unique_ptr MemoryOptimizePass::ApplyImpl( } } } - // graph->ResolveHazard(var_nodes_); + graph->ResolveHazard(var_nodes_); return graph; } -- GitLab