提交 a64a6f52 编写于 作者: Y Yang Yang

id to block_id

上级 7c48335b
......@@ -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);
}
}
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册