From 4d259b9104921cccf97a1fad99435ce979e00f89 Mon Sep 17 00:00:00 2001 From: WeiXin Date: Mon, 12 Jul 2021 16:32:33 +0800 Subject: [PATCH] Support finetuning the model saved on the mac platform on the Linux platform (#34027) --- paddle/fluid/operators/matmul_op.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/matmul_op.cc b/paddle/fluid/operators/matmul_op.cc index e226ab53288..988a6c4f7da 100644 --- a/paddle/fluid/operators/matmul_op.cc +++ b/paddle/fluid/operators/matmul_op.cc @@ -232,7 +232,9 @@ class MatMulGradKernel : public framework::OpKernel { int head_number = 1; #if defined(PADDLE_WITH_MKLML) && !defined(PADDLE_WITH_CUDA) && \ !defined(PADDLE_WITH_HIP) - head_number = context.Attr("head_number"); + if (context.HasAttr("head_number")) { + head_number = context.Attr("head_number"); + } #endif if (head_number <= 1 && a.dims().size() == 3 && b.dims().size() <= 2) { -- GitLab