Skip to content

Commit 70c073a

Browse files
authored
fix analysis_predictor when func is called multiple times, test=release/1.6 (#21663)
1 parent 2de1029 commit 70c073a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

paddle/fluid/inference/api/analysis_predictor.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,7 @@ bool AnalysisPredictor::PrepareScope(
122122
scope_ = parent_scope;
123123
status_is_cloned_ = true;
124124
} else {
125-
if (config_.use_gpu_) {
126-
paddle::framework::InitDevices(false);
127-
} else {
128-
paddle::framework::InitDevices(false, {});
129-
}
125+
paddle::framework::InitDevices(false);
130126
scope_.reset(new paddle::framework::Scope());
131127
status_is_cloned_ = false;
132128
}

0 commit comments

Comments
 (0)