From 3e427441910bbccddf0222d4bd05ecfdea9302e7 Mon Sep 17 00:00:00 2001 From: "Yang Yang(Tony)" Date: Mon, 16 Oct 2017 11:15:10 -0700 Subject: [PATCH] update based on review --- doc/design/executor.md | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/doc/design/executor.md b/doc/design/executor.md index ab2d6c3558c..b5fb6c5c3c1 100644 --- a/doc/design/executor.md +++ b/doc/design/executor.md @@ -20,31 +20,4 @@ It does not do graph partitioning, meaning dividing the `ProgramDesc` into sever ## Implementation -`Executor` evaluates a `ProgramDesc`. Essentially, it instantiates Variables and Operators, then run all the operators - -```c++ -void Executor::Run(const ProgramDesc& pdesc, Scope* scope, int block_id) { - auto& block = pdesc.blocks(block_id); - auto& device = device_contexts_[0]; - - // Instantiate all the vars in the global scope - for (auto& var : block.vars()) { - scope->NewVar(var.name()); - } - - // Run the block - Scope& local_scope = scope->NewScope(); - for (auto& op_desc : block.ops()) { - for (auto& var : op_desc.outputs()) { - 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(op_desc); - op->Run(local_scope, *device); - } -} -``` +`Executor` evaluates a `ProgramDesc`. Essentially, it instantiates Variables and Operators, then run all the operators in sequence. [[code]](https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/framework/executor.cc) -- GitLab