diff --git a/paddle/fluid/inference/api/analysis_config.cc b/paddle/fluid/inference/api/analysis_config.cc index 398b51e32116d7567094f4a3b00f5058346dc1cc..f6048449bcd4b255e5d836e6295ffb9fd6815505 100644 --- a/paddle/fluid/inference/api/analysis_config.cc +++ b/paddle/fluid/inference/api/analysis_config.cc @@ -324,8 +324,8 @@ void AnalysisConfig::Update() { } #ifdef PADDLE_WITH_MKLDNN - // Do not optimize before quantization - if (enable_memory_optim_ && !use_mkldnn_quantizer_) { + // Do not optimize when mkldnn is on + if (enable_memory_optim_ && !use_mkldnn_) { #else if (enable_memory_optim_) { #endif