Skip to content

keep fill_constant consistency between static and dynamic mode #67587

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

Merged
merged 6 commits into from
Aug 26, 2024

Conversation

deepllz
Copy link
Contributor

@deepllz deepllz commented Aug 20, 2024

PR Category

Auto Parallel

PR Types

Bug fixes

Description

修复fill_constant类算子动转静不统一的问题,例如:
paddle.ones(shape=100, "float32")在动态图下能够运行,但是静态图下会报错:
TypeError: The type of 'shape' in fill_constant must be (<class 'paddle.base.framework.Variable'>, <class 'list'>, <class 'tuple'>), but received <class 'int'>
动态图下传入shape=100的结果等价于shape=[100]
因此修复方式:传入shape是int的时候,转换成list[int]
Pcard-73145

Copy link

paddle-bot bot commented Aug 20, 2024

你的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.

@deepllz deepllz closed this Aug 21, 2024
@deepllz deepllz reopened this Aug 21, 2024
@deepllz deepllz changed the title fix fill_constant bug in static mode keep fill_constant consistency between static and dynamic mode Aug 21, 2024
Copy link
Contributor

@From00 From00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@From00 From00 merged commit d62e4fc into PaddlePaddle:develop Aug 26, 2024
28 checks passed
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