diff --git a/paddle/fluid/operators/mkldnn/fc_mkldnn_op.cc b/paddle/fluid/operators/mkldnn/fc_mkldnn_op.cc index 590ffe4d0d41b63069a13f3f6ed44afd5a79913e..8621e79509a39e060d740aa25ec1bb028f6ddd27 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,