未验证 提交 2bb13582 编写于 作者: 石晓伟 提交者: GitHub

fix analysis_predictor when func is called multiple times, test=release/1.6 (#21665)

上级 d3a96632
...@@ -122,11 +122,7 @@ bool AnalysisPredictor::PrepareScope( ...@@ -122,11 +122,7 @@ bool AnalysisPredictor::PrepareScope(
scope_ = parent_scope; scope_ = parent_scope;
status_is_cloned_ = true; status_is_cloned_ = true;
} else { } else {
if (config_.use_gpu_) {
paddle::framework::InitDevices(false); paddle::framework::InitDevices(false);
} else {
paddle::framework::InitDevices(false, {});
}
scope_.reset(new paddle::framework::Scope()); scope_.reset(new paddle::framework::Scope());
status_is_cloned_ = false; status_is_cloned_ = false;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册