diff --git a/paddle/fluid/inference/api/analysis_predictor.cc b/paddle/fluid/inference/api/analysis_predictor.cc index bf20bd73cc4881..6b57f1fabf4bd7 100644 --- a/paddle/fluid/inference/api/analysis_predictor.cc +++ b/paddle/fluid/inference/api/analysis_predictor.cc @@ -1102,6 +1102,10 @@ bool AnalysisPredictor::Run(const std::vector &inputs, } #endif + if (config_.shape_range_info_collected()) { + HookCollectShapeRangeInfo(); + } + // Run the inference program // if share variables, we need not create variables executor_->Run(); @@ -1166,6 +1170,10 @@ bool AnalysisPredictor::Run(const std::vector &inputs, } #endif + if (config_.shape_range_info_collected()) { + HookCollectShapeRangeInfo(); + } + // Run the inference program // if share variables, we need not create variables executor_->Run();