未验证 提交 1d1ca0f8 编写于 作者: W WeiXin 提交者: GitHub

[Cherry-Pick]Support finetuning the model saved on the MAC on the Linux (#34027) (#34154)

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

原始PR: #34027
上级 999c2917
...@@ -232,7 +232,9 @@ class MatMulGradKernel : public framework::OpKernel<T> { ...@@ -232,7 +232,9 @@ class MatMulGradKernel : public framework::OpKernel<T> {
int head_number = 1; int head_number = 1;
#if defined(PADDLE_WITH_MKLML) && !defined(PADDLE_WITH_CUDA) && \ #if defined(PADDLE_WITH_MKLML) && !defined(PADDLE_WITH_CUDA) && \
!defined(PADDLE_WITH_HIP) !defined(PADDLE_WITH_HIP)
if (context.HasAttr("head_number")) {
head_number = context.Attr<int>("head_number"); head_number = context.Attr<int>("head_number");
}
#endif #endif
if (head_number <= 1 && a.dims().size() == 3 && b.dims().size() <= 2) { if (head_number <= 1 && a.dims().size() == 3 && b.dims().size() <= 2) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册