From c1802f9172cb9ff1b00390e87630d29e020aec24 Mon Sep 17 00:00:00 2001 From: jakpiase Date: Thu, 18 Nov 2021 10:03:45 +0100 Subject: [PATCH] Fix for wrong results in segmentation models (#37310) * fix * ci rerun * ci rerun * ci Rerun --- 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 a387bbc346..123ea5f1ef 100644 --- a/paddle/fluid/platform/mkldnn_helper.h +++ b/paddle/fluid/platform/mkldnn_helper.h @@ -230,6 +230,9 @@ inline dnnl::memory::format_tag GetMKLDNNFormat(dnnl::memory::desc mem_desc) { } else if (strides[2] >= strides[3] && strides[3] >= strides[1] && strides[1] >= strides[0]) { return dnnl::memory::format_tag::cdba; + } else if (strides[3] >= strides[2] && strides[2] >= strides[0] && + strides[0] >= strides[1]) { + return dnnl::memory::format_tag::dcab; } else { return dnnl::memory::format_tag::nhwc; } -- GitLab