[Dy2stat] Fix to_tensor Bug Reported from QA (#32701)
Dy2stat failed when user writes return paddle.to_tensor(xxx), the reason is that visit_Expr doesn't work when the Expr is in return. Some other statements may trigger same bug. To fix it, we re-wrote a transformer to transform paddle.to_tensor to paddle.assign for all Call nodes.
Showing
想要评论请 注册 或 登录