From 2bb135825eacaa3f76ee8d2e382ac06ae4177073 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:41 +0800 Subject: [PATCH] fix analysis_predictor when func is called multiple times, test=release/1.6 (#21665) --- 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 6bb4e8e925a..9873d069b4c 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