From b0e9e48d47fbe2bd1df19bc88dcc8e766aa2795d Mon Sep 17 00:00:00 2001 From: xiaoxiaohehe001 <49090790+xiaoxiaohehe001@users.noreply.github.com> Date: Tue, 20 Dec 2022 17:25:18 +0800 Subject: [PATCH] fix_arguments (#49186) --- paddle/fluid/inference/api/analysis_predictor.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/inference/api/analysis_predictor.cc b/paddle/fluid/inference/api/analysis_predictor.cc index 5dced520f3..2fe3dbe13e 100644 --- a/paddle/fluid/inference/api/analysis_predictor.cc +++ b/paddle/fluid/inference/api/analysis_predictor.cc @@ -1365,7 +1365,9 @@ void AnalysisPredictor::OptimizeInferenceProgram() { #if defined(_WIN32) argument_->PartiallyRelease(); #else - if (config_.mkldnn_enabled() || config_.tensorrt_engine_enabled()) { + if (config_.mkldnn_enabled() || + (config_.tensorrt_engine_enabled() && + config_.tensorrt_precision_mode_ == AnalysisConfig::Precision::kInt8)) { argument_->PartiallyRelease(); } else { argument_.reset(nullptr); -- GitLab