Skip to content

Commit

Permalink
[Cherry-Pick]Support finetuning the model saved on the MAC on the Li…
Browse files Browse the repository at this point in the history
…nux (#34027) (#34154)

修复《jit.save在Mac系统上保存的模型,在Linux平台上无法对模型进行重训练》的问题。

原始PR: #34027
  • Loading branch information
hbwx24 committed Jul 15, 2021
1 parent 999c291 commit 1d1ca0f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion paddle/fluid/operators/matmul_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ class MatMulGradKernel : public framework::OpKernel<T> {
int head_number = 1;
#if defined(PADDLE_WITH_MKLML) && !defined(PADDLE_WITH_CUDA) && \
!defined(PADDLE_WITH_HIP)
head_number = context.Attr<int>("head_number");
if (context.HasAttr("head_number")) {
head_number = context.Attr<int>("head_number");
}
#endif

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

0 comments on commit 1d1ca0f

Please sign in to comment.