From a64a6f527b5c170b726c205cb6548b19171d5810 Mon Sep 17 00:00:00 2001 From: Yang Yang Date: Mon, 16 Oct 2017 18:17:25 +0000 Subject: [PATCH] id to block_id --- paddle/framework/prune.cc | 8 ++++---- paddle/framework/prune.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/paddle/framework/prune.cc b/paddle/framework/prune.cc index 284541f19..c9a1d7d5c 100644 --- a/paddle/framework/prune.cc +++ b/paddle/framework/prune.cc @@ -39,11 +39,11 @@ bool HasDependentVar(const OpDesc& op_desc, return false; } -void Prune(const ProgramDesc& input, ProgramDesc& output, int id) { +void Prune(const ProgramDesc& input, ProgramDesc& output, int block_id) { // TODO(tonyyang-svail): // - will change to use multiple blocks for RNN op and Cond Op - auto& block = input.blocks(id); + auto& block = input.blocks(block_id); auto& ops = block.ops(); bool expect_feed = true; @@ -85,11 +85,11 @@ void Prune(const ProgramDesc& input, ProgramDesc& output, int id) { std::reverse(should_run.begin(), should_run.end()); output = input; - auto* op_field = output.mutable_blocks(id)->mutable_ops(); + auto* op_field = output.mutable_blocks(block_id)->mutable_ops(); op_field->Clear(); for (size_t i = 0; i < should_run.size(); ++i) { if (should_run[i]) { - *op_field->Add() = input.blocks(id).ops(i); + *op_field->Add() = input.blocks(block_id).ops(i); } } diff --git a/paddle/framework/prune.h b/paddle/framework/prune.h index 3e1d58f61..1c74d3b76 100644 --- a/paddle/framework/prune.h +++ b/paddle/framework/prune.h @@ -20,7 +20,7 @@ limitations under the License. */ namespace paddle { namespace framework { -void Prune(const ProgramDesc& input, ProgramDesc& output, int id); +void Prune(const ProgramDesc& input, ProgramDesc& output, int block_id); } // namespace framework } // namespace paddle -- GitLab