diff --git a/paddle/fluid/framework/details/sequential_execution_pass.cc b/paddle/fluid/framework/details/sequential_execution_pass.cc index 6725cdfb2039fe7cc3ec44b0c2c43dadb6ecee0f..649bdb0985d4d666c76d16ca843298fe23b33ed9 100644 --- a/paddle/fluid/framework/details/sequential_execution_pass.cc +++ b/paddle/fluid/framework/details/sequential_execution_pass.cc @@ -16,6 +16,7 @@ #include #include #include +#include "paddle/fluid/framework/op_proto_maker.h" namespace paddle { namespace framework { @@ -28,7 +29,7 @@ static bool IsSameOpDesc(OpDesc *op1, OpDesc *op2) { std::unique_ptr SequentialExecutionPass::ApplyImpl( std::unique_ptr graph) const { - auto ops = this->Get>(kAllOpDescs); + auto &ops = Get>(kAllOpDescs); std::vector op_node_list; op_node_list.reserve(ops.size()); @@ -39,7 +40,6 @@ std::unique_ptr SequentialExecutionPass::ApplyImpl( for (ir::Node *node : graph->Nodes()) { if (!node->IsOp()) continue; std::unordered_set preceding_ops; - pending_ops[node]; for (auto *in : node->inputs) { PADDLE_ENFORCE(in->IsVar(), "Preceding Node of Op Nodes must be Var Node"); @@ -66,8 +66,8 @@ std::unique_ptr SequentialExecutionPass::ApplyImpl( } PADDLE_ENFORCE_NOT_NULL(found_node, "Cannot find op_desc in graph: %s", - found_node->Op()->Type()); - for (auto *pending_op : pending_ops.at(found_node)) { + op_desc->Type()); + for (auto *pending_op : pending_ops[found_node]) { if (--op_deps.at(pending_op) == 0) { ready_ops.insert(pending_op); }