From a5d1592f6ce8edaf4363da972b0d0df8224b5095 Mon Sep 17 00:00:00 2001 From: Jacek Czaja Date: Thu, 9 Jul 2020 11:24:46 +0200 Subject: [PATCH] Added missing oneDNN format (#25450) test=develop --- paddle/fluid/platform/mkldnn_helper.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paddle/fluid/platform/mkldnn_helper.h b/paddle/fluid/platform/mkldnn_helper.h index 08b86b07278..0fcb2367916 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; } -- GitLab