diff --git a/paddle/framework/prune.cc b/paddle/framework/prune.cc index 284541f199da27fd3071bfbc54426b5faca10c9f..c9a1d7d5cf99059ea2a2766a550f23fc639c8ece 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 3e1d58f61fa928dd18062dc06b2cecfd2fbcf84b..1c74d3b763b778cfef176a67003a66cb008e42b6 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