There was an error while loading. Please reload this page.
1 parent 730ccd9 commit 1d31764Copy full SHA for 1d31764
paddle/fluid/inference/api/analysis_predictor.cc
@@ -409,7 +409,10 @@ void AnalysisPredictor::MkldnnPreSet(
409
void AnalysisPredictor::MkldnnPostReset() {
410
#ifdef PADDLE_WITH_MKLDNN
411
// In cache clearing mode.
412
- if (config_.mkldnn_cache_capacity_ > 0) {
+ if (config_.mkldnn_cache_capacity_ > 0 &&
413
+ static_cast<platform::MKLDNNDeviceContext *>(
414
+ (&platform::DeviceContextPool::Instance())->Get(platform::CPUPlace()))
415
+ ->GetCachedObjectsNumber() > 0) {
416
if (VLOG_IS_ON(2)) {
417
auto shape_blob_size = static_cast<platform::MKLDNNDeviceContext *>(
418
(&platform::DeviceContextPool::Instance())
0 commit comments