diff --git a/paddle/fluid/inference/api/analysis_predictor.cc b/paddle/fluid/inference/api/analysis_predictor.cc index e628216a5ed87..e0dc0f72f17dc 100644 --- a/paddle/fluid/inference/api/analysis_predictor.cc +++ b/paddle/fluid/inference/api/analysis_predictor.cc @@ -303,7 +303,9 @@ static void DisablePrepareDataOpt( disable_opt || pre_disable_opt); } // disable prepare data if unfriendly op is found - disable_opt = IsPrepareDataOptTargetOp(op); + if (!disable_opt) { + disable_opt = IsPrepareDataOptTargetOp(op); + } } }