Skip to content

Commit 1d1ca0f

Browse files
authored
[Cherry-Pick]Support finetuning the model saved on the MAC on the Linux (#34027) (#34154)
修复《jit.save在Mac系统上保存的模型,在Linux平台上无法对模型进行重训练》的问题。 原始PR: #34027
1 parent 999c291 commit 1d1ca0f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

paddle/fluid/operators/matmul_op.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ class MatMulGradKernel : public framework::OpKernel<T> {
232232
int head_number = 1;
233233
#if defined(PADDLE_WITH_MKLML) && !defined(PADDLE_WITH_CUDA) && \
234234
!defined(PADDLE_WITH_HIP)
235-
head_number = context.Attr<int>("head_number");
235+
if (context.HasAttr("head_number")) {
236+
head_number = context.Attr<int>("head_number");
237+
}
236238
#endif
237239

238240
if (head_number <= 1 && a.dims().size() == 3 && b.dims().size() <= 2) {

0 commit comments

Comments
 (0)