Unroll If ops when doing ONNXIFI transform (#18039)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18039
We basically flatten the whole net in order to ease the ONNXIFI transform. An alternative way is to ONNXIFI the internal net of the If op, which can be done by adding interfacing inputs/outputs that the internal then_net or else_net referred to the inputs/outputs of the If op. This will be left as an TODO option.
Reviewed By: zrphercule
Differential Revision:
D14452132
fbshipit-source-id:
00ad48d40da6fb8eabf9cca36701bcf61cbe4edc