Unroll If ops when doing ONNXIFI transform (#18039)
authorYinghai Lu <yinghai@fb.com>
Thu, 14 Mar 2019 21:45:28 +0000 (14:45 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 14 Mar 2019 21:51:24 +0000 (14:51 -0700)
commitb263a2d8a143dccd8c6975153c857a894f2d552d
tree211a7d80c6693c217c5c4f8b4f7938713a90b54e
parent77d6d9e1b893b3d43d9079c2bb1b35276c94e958
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
caffe2/opt/backend_transformer_base.cc
caffe2/opt/onnxifi_transformer.cc