diff --git a/paddle/fluid/inference/api/paddle_analysis_config.h b/paddle/fluid/inference/api/paddle_analysis_config.h index 067d8986b140ca373b65eb985bea4632f7a735cd..4d6d1ab36e45b9a857fd2610315b4ad65c00945f 100644 --- a/paddle/fluid/inference/api/paddle_analysis_config.h +++ b/paddle/fluid/inference/api/paddle_analysis_config.h @@ -526,20 +526,20 @@ struct AnalysisConfig { bool use_tensorrt_{false}; // For workspace_size, refer it from here: // https://docs.nvidia.com/deeplearning/sdk/tensorrt-developer-guide/index.html#troubleshooting - int tensorrt_workspace_size_; + int tensorrt_workspace_size_{1 << 30}; // While TensorRT allows an engine optimized for a given max batch size // to run at any smaller size, the performance for those smaller // sizes may not be as well-optimized. Therefore, Max batch is best // equivalent to the runtime batch size. - int tensorrt_max_batchsize_; + int tensorrt_max_batchsize_{1}; // We transform the Ops that can be converted into TRT layer in the model, // and aggregate these Ops into subgraphs for TRT execution. // We set this variable to control the minimum number of nodes in the // subgraph, 3 as default value. int tensorrt_min_subgraph_size_{3}; - Precision tensorrt_precision_mode_; - bool trt_use_static_engine_; - bool trt_use_calib_mode_; + Precision tensorrt_precision_mode_{Precision::kFloat32}; + bool trt_use_static_engine_{false}; + bool trt_use_calib_mode_{true}; std::map> min_input_shape_{}; std::map> max_input_shape_{}; std::map> optim_input_shape_{};