From 11c6dc6798d5e12f3ea7e0d4eea996e47ca8bb7d Mon Sep 17 00:00:00 2001 From: "Yang Yang(Tony)" Date: Wed, 11 Oct 2017 11:00:32 -0700 Subject: [PATCH] Update executor.md --- doc/design/executor.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/design/executor.md b/doc/design/executor.md index 049ddb6a59e..30b76b3385b 100644 --- a/doc/design/executor.md +++ b/doc/design/executor.md @@ -16,16 +16,16 @@ void Executor::Run(const ProgramDesc& pdesc, Scope* scope, int block_id) { // Run the block Scope& local_scope = scope->NewScope(); - for (size_t i = 0; i < should_run.size(); ++i) { - for (auto var : block.ops(i).outputs()) { - for (auto argu : var.arguments()) { + for (auto& op_desc : block.ops()) { + for (auto& var : op_desc) { + for (auto& argu : var.arguments()) { // Create temp variable in the local_scope if (local_scope.FindVar(argu) == nullptr) { local_scope.NewVar(argu); } } } - auto op = paddle::framework::OpRegistry::CreateOp(block.ops(i)); + auto op = paddle::framework::OpRegistry::CreateOp(op_desc); op->Run(local_scope, *device); } } -- GitLab