Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cos/sin double_grad functor error when meets null ptr #71332

Merged

Conversation

HydrogenSulfate
Copy link
Contributor

@HydrogenSulfate HydrogenSulfate commented Feb 28, 2025

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

Pcard-75624

修复 Sin/Cos Double Grad functor 中为判空直接获取输出指针的行为,将其移动到了判断分支的内部,避免出现类似如下的报错

RuntimeError: (NotFound) Unable to get phi::DenseTensor data of Output d2x in operator SinDoubleGrad. Possible reasons are:
  1. The d2x is not the Output of operator SinDoubleGrad;
  2. The d2x has no corresponding variable passed in;
  3. The d2x corresponding variable is not initialized.
  [Hint: pointer dX should not be null.] (at ../paddle/phi/kernels/funcs/activation_functor.h:178)

Copy link

paddle-bot bot commented Feb 28, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@zyfncg zyfncg merged commit 0b8e213 into PaddlePaddle:develop Mar 3, 2025
36 checks passed
@HydrogenSulfate HydrogenSulfate deleted the fix_cos_sin_double_grad_functor branch March 3, 2025 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants