Skip to content

Conversation

@lshpku
Copy link
Contributor

@lshpku lshpku commented Aug 6, 2025

PR Category

CINN

PR Types

Bug fixes

Description

CINN在处理int类型的pow时,对 pow(0, -exp) 这种情况是返回-1,但torch是返回0;PHI算子库的pow已经跟torch对齐了(#73274),因此这个PR把CINN也和torch对齐

本PR的正确性通过CE的 pow_0_func.py 验证

注:从数学上说pow底数为0时指数不允许为负数,这种情况就和0/0一样在数学上不存在,用户本来不应该指望此时的输出是有意义的值,但是考虑到框架使用的一致性,还是和torch对齐一下

Pcard-85711

@paddle-bot
Copy link

paddle-bot bot commented Aug 6, 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.

@lshpku lshpku changed the title [CINN] Align pow int for base=0 and exponent<0 [CINN] Align int pow with torch for base=0 and exponent<0 Aug 7, 2025
@lshpku lshpku merged commit 4f31055 into PaddlePaddle:develop Aug 8, 2025
75 of 77 checks passed
Enigmatisms pushed a commit to Enigmatisms/Paddle that referenced this pull request Aug 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants