From 1ec626b1e88f17cc0eb958583098bfb80006a9af Mon Sep 17 00:00:00 2001 From: "joanna.wozna.intel" Date: Thu, 16 Jun 2022 09:14:40 +0200 Subject: [PATCH] Revert md-in-tensor refactoring (#43564) --- paddle/fluid/operators/mkldnn/softmax_mkldnn_op.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/mkldnn/softmax_mkldnn_op.cc b/paddle/fluid/operators/mkldnn/softmax_mkldnn_op.cc index ef5d95dca3f..eb5059feaec 100644 --- a/paddle/fluid/operators/mkldnn/softmax_mkldnn_op.cc +++ b/paddle/fluid/operators/mkldnn/softmax_mkldnn_op.cc @@ -47,8 +47,12 @@ class SoftmaxMKLDNNHandler platform::errors::InvalidArgument( "The shape of input and output tensor must be identical.")); - this->AcquireForwardPrimitiveDescriptor(prop_kind::forward_scoring, - input->mem_desc(), axis); + auto softmax_tz = phi::vectorize(input->dims()); + auto md = memory::desc(softmax_tz, platform::MKLDNNGetDataType(), + input->format()); + + this->AcquireForwardPrimitiveDescriptor(prop_kind::forward_scoring, md, + axis); } SoftmaxMKLDNNHandler(const framework::ExecutionContext& ctx, -- GitLab