Skip to content

Commit

Permalink
fix lod_tensor_array gc (#42377)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxicoding committed Apr 29, 2022
1 parent e4f993e commit 36343c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions paddle/fluid/framework/executor_gc_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ void DeleteUnusedTensors(const Scope &scope,
for (auto &t : *lod_tensor_arr) {
garbages.emplace_back(t.MoveMemoryHolder());
}
// NOTE(wangxi): need clear the vector, otherwise lod_tensor_arr.size() is
// wrong, if size() decrease in next step, an error maybe occur.
lod_tensor_arr->clear();
} else if (var->IsType<Strings>()) {
} else {
PADDLE_THROW(platform::errors::Unimplemented(
Expand Down

1 comment on commit 36343c1

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.