Fix beam_search memory leak. (#10185)

release/0.12.0
gongweibao 7 years ago committed by GitHub
parent ee0497c45a
commit 2f53cd0a76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);

Loading…
Cancel
Save