[CINN] Align int pow with torch for base=0 and exponent<0 #74450
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
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