From 70c073a0019f3405f9074579a8c48a43281dfdea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E6=99=93=E4=BC=9F?= <39303645+Shixiaowei02@users.noreply.github.com> Date: Mon, 16 Dec 2019 10:17:45 +0800 Subject: [PATCH] fix analysis_predictor when func is called multiple times, test=release/1.6 (#21663) --- paddle/fluid/inference/api/analysis_predictor.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/paddle/fluid/inference/api/analysis_predictor.cc b/paddle/fluid/inference/api/analysis_predictor.cc index f3fbb1d4d34..c68b1f719d1 100644 --- a/paddle/fluid/inference/api/analysis_predictor.cc +++ b/paddle/fluid/inference/api/analysis_predictor.cc @@ -122,11 +122,7 @@ bool AnalysisPredictor::PrepareScope( scope_ = parent_scope; status_is_cloned_ = true; } else { - if (config_.use_gpu_) { - paddle::framework::InitDevices(false); - } else { - paddle::framework::InitDevices(false, {}); - } + paddle::framework::InitDevices(false); scope_.reset(new paddle::framework::Scope()); status_is_cloned_ = false; } -- GitLab