Paddle icon indicating copy to clipboard operation
Paddle copied to clipboard

[ Dy2Static ]Modify while interface[python] to fit onnx

Open 2742195759 opened this issue 3 years ago • 1 comments

PR types

Others

PR changes

Others

Describe

Onnx 需要WhileOp的输入和输出满足特定关系: 输出必定在输入中,因此修改了while的输入输出解析逻辑,满足了上述的要求。同时也需要适配将 CreateUndefinedVariable 函数中的 assign 操作放到 block0 中,否则 whileop 会在每个Step TensorCopy的时候发现输入没有被初始化。

for i in range(tensor):
    s += i 

其中 s 就是 undefined vars,在 for 内部初始化,因此必须在外面填充一个assign才行。

2742195759 avatar Aug 10 '22 03:08 2742195759

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

paddle-bot[bot] avatar Aug 10 '22 03:08 paddle-bot[bot]