diff --git a/paddle/fluid/platform/mkldnn_helper.h b/paddle/fluid/platform/mkldnn_helper.h index 08b86b072781f512fbc2e15e154e1e6fc25cf9e1..0fcb23679164079865947b0b0b539ae344732b58 100644 --- a/paddle/fluid/platform/mkldnn_helper.h +++ b/paddle/fluid/platform/mkldnn_helper.h @@ -178,6 +178,9 @@ inline mkldnn::memory::format_tag GetMKLDNNFormat( if (strides[0] >= strides[1] && strides[1] >= strides[2] && strides[2] >= strides[3]) { return mkldnn::memory::format_tag::nchw; + } else if (strides[2] >= strides[3] && strides[3] >= strides[1] && + strides[1] >= strides[0]) { + return mkldnn::memory::format_tag::cdba; } else { return mkldnn::memory::format_tag::nhwc; }