-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 div error when dtype is int64 in static mode #53705
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM~~~
* Fix div error when dtype is int64 in static mode * Fix out dtype
PR types
Bug fixes
PR changes
APIs
Description
下面代码动态图返回结果是0.75,动转静(静态图)返回结果是0。正确结果应该是0.75,因为这里的除法是truediv。
动态图的代码中将类型统一转成了float32类型,所以计算结果正确
但是静态图variable的__truediv__方法中没有对应类型转换的代码,本PR的修改参考了老动态图varbase的truediv的代码
PCard-64703