diff --git a/paddle/fluid/operators/mkldnn/fc_mkldnn_op.cc b/paddle/fluid/operators/mkldnn/fc_mkldnn_op.cc index 30db4b3be662b84f8146dd741f32e6fabf6c1874..a130db68a5816f31748c3a2863c144342b7f9ef0 100644 --- a/paddle/fluid/operators/mkldnn/fc_mkldnn_op.cc +++ b/paddle/fluid/operators/mkldnn/fc_mkldnn_op.cc @@ -178,6 +178,8 @@ class FCPrimitiveFactory { } else { out->set_format(in_format); } + out->set_mem_desc({phi::vectorize(out->dims()), + platform::MKLDNNGetDataType(), out->format()}); } void UpdateDataPointers(const ExecutionContext& ctx, Tensor* out,