未验证 提交 2f53cd0a 编写于 作者: G gongweibao 提交者: GitHub

Fix beam_search memory leak. (#10185)

上级 ee0497c4
...@@ -223,8 +223,9 @@ void BeamSearchDecoder<T>::ConvertSentenceVectorToLodTensor( ...@@ -223,8 +223,9 @@ void BeamSearchDecoder<T>::ConvertSentenceVectorToLodTensor(
sentence_vector_list[src_idx].size()); sentence_vector_list[src_idx].size());
} }
auto cpu_place = new paddle::platform::CPUPlace(); auto cpu_place = std::unique_ptr<paddle::platform::CPUPlace>(
paddle::platform::CPUDeviceContext cpu_ctx(*cpu_place); new paddle::platform::CPUPlace());
paddle::platform::CPUDeviceContext cpu_ctx(*cpu_place.get());
framework::LoD lod; framework::LoD lod;
lod.push_back(source_level_lod); lod.push_back(source_level_lod);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册