From 8f37c66f8eb21a5b2c65ce6c04ebc77ed06762c0 Mon Sep 17 00:00:00 2001 From: jakpiase Date: Tue, 6 Sep 2022 12:31:09 +0200 Subject: [PATCH] Added concat workaround for vivo model (#45091) * concat workaround * CI rerun --- paddle/fluid/operators/mkldnn/concat_mkldnn_op.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/mkldnn/concat_mkldnn_op.cc b/paddle/fluid/operators/mkldnn/concat_mkldnn_op.cc index 837d4357737..b16576505df 100644 --- a/paddle/fluid/operators/mkldnn/concat_mkldnn_op.cc +++ b/paddle/fluid/operators/mkldnn/concat_mkldnn_op.cc @@ -89,7 +89,8 @@ class ConcatMKLDNNHandler // formats are being set in inputs. In that scenario we are enforcing using // a dense format, because it is the most common one and should be the best // in terms of the performance - if (dst_dims[concat_axis] == static_cast(srcs_md.size())) { + const auto src0_tz = srcs_md[0].dims(); + if (std::find(src0_tz.begin(), src0_tz.end(), 1) != src0_tz.end()) { dst_md = memory::desc( dst_dims, dt, platform::GetPlainMKLDNNFormat(dst_dims.size())); } else { -- GitLab