Skip to content
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

paddlepaddle2.0静态图模型实现循环 #64099

Open
VVJY opened this issue May 8, 2024 · 1 comment
Open

paddlepaddle2.0静态图模型实现循环 #64099

VVJY opened this issue May 8, 2024 · 1 comment
Assignees
Labels

Comments

@VVJY
Copy link

VVJY commented May 8, 2024

请提出你的问题 Please ask your question

paddle2.0版本静态图模式下,想要对一个batch的ins做循环,以下各种用法都提示不存在接口,请问正确的用法应该是怎样的,或者怎样高效实现循环呢:
[i] = paddle.static.While(loop_cond, loop_body,[i])
报错:'module' object has no attribute 'While'
[i] = paddle.static.nn.control_flow.While(loop_cond, loop_body,[i])
报错:'module' object has no attribute 'control_flow'
[i] = paddle.static.nn.while_loop(loop_cond, loop_body,[i])

@minghaoBD
Copy link
Contributor

你好,请参考这个文档:https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/static/nn/while_loop_cn.html#while-loop

我在python38 paddle2.0的环境下测试了,输出正常。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants