Skip to content

Conversation

@lshpku
Copy link
Contributor

@lshpku lshpku commented May 20, 2025

PR Category

CINN

PR Types

Bug fixes

Description

修复scale op在对int/int64类型进行scale时出现的cast报错

说明:scale默认是用float类型作为乘的参数,之前scale不会用于操作int类型的下标,都是操作浮点类型,所以没问题,而支持arange后出现了scale直接操作下标的场景,就发生类型冲突了

本PR使用common::cast接口替换Cast::Make,前者可以直接对常数进行eager cast,避免出现int(5.0f)这样矛盾的情况,这会导致后续convert_int32_to_int64报错

Pcard-85711

@paddle-bot
Copy link

paddle-bot bot commented May 20, 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] Fix dtype casting of Scale op [CINN] Fix int type casting of Scale op May 21, 2025
@lshpku lshpku merged commit fc24bc7 into PaddlePaddle:develop May 21, 2025
50 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants