diff --git a/paddle/framework/prune.cc b/paddle/framework/prune.cc index 00fe551e55e6be6d4e36a6953fa5b23054fca6e4..ddd6b993d40f72cba919fad95318f70409c98bca 100644 --- a/paddle/framework/prune.cc +++ b/paddle/framework/prune.cc @@ -182,6 +182,7 @@ void prune_impl(const proto::ProgramDesc& input, proto::ProgramDesc* output, // TODO(fengjiayi): Prune() could be inplaced to avoid unnecessary copies void Prune(const proto::ProgramDesc& input, proto::ProgramDesc* output) { std::set dependent_vars; + output->clear_blocks(); prune_impl(input, output, 0, -1, dependent_vars); }