From 0362ef75f4c988d875bf8ae08f1c11e0f8318b78 Mon Sep 17 00:00:00 2001 From: Xin Pan Date: Fri, 22 Feb 2019 20:32:46 +0800 Subject: [PATCH] fix test=develop --- paddle/fluid/framework/details/memory_optimize_pass.cc | 2 +- paddle/fluid/framework/ir/graph.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/details/memory_optimize_pass.cc b/paddle/fluid/framework/details/memory_optimize_pass.cc index fd02bc469..8d3869f4d 100644 --- a/paddle/fluid/framework/details/memory_optimize_pass.cc +++ b/paddle/fluid/framework/details/memory_optimize_pass.cc @@ -337,4 +337,4 @@ void MemoryOptimizePass::RenameVarInGraphNode(const std::string& var, REGISTER_PASS(memory_optimize_pass, paddle::framework::details::MemoryOptimizePass) - .RequireGraphAttr(paddle::framework::details::kAllOpDescs); + .RequireGraphAttr(paddle::framework::details::kStaleProgramOpDescs); diff --git a/paddle/fluid/framework/ir/graph.h b/paddle/fluid/framework/ir/graph.h index 8cb3b874d..cfd974e4b 100644 --- a/paddle/fluid/framework/ir/graph.h +++ b/paddle/fluid/framework/ir/graph.h @@ -195,6 +195,12 @@ class Graph { return nullptr; } + // Returns reference to the original program. + // WARN: After a series of passes, the current graph can be quite + // different from OriginProgram. Caller shouldn't assume much from + // the returned OriginProgram. + const ProgramDesc &OriginProgram() const { return program_; } + // This method takes ownership of `node`. ir::Node *AddNode(ir::Node *node) { PADDLE_ENFORCE(node_set_.find(node) == node_set_.end()); -- GitLab