-
Yanghan Wang authored
Summary: This diff cleans up the process of exporting RCNN to predictor by tracing. - Implement a new `D2 (https://github.com/facebookresearch/d2go/commit/d86ecc92eb97f14fcd97d626185f61c6817351e4)TorchscriptTracingExport` which utilizes D2 (https://github.com/facebookresearch/d2go/commit/d86ecc92eb97f14fcd97d626185f61c6817351e4)'s `TracingAdapter`. It's capable to handle more complicated input/output data structures, for example the `MultiDictInMultiDictOut` in unit test. Some duplicated code for serializing can also be removed. - Later on we'll move `DefaultTorchscriptExport` to `mobile_cv.predictor` which doesn't have D2 (https://github.com/facebookresearch/d2go/commit/d86ecc92eb97f14fcd97d626185f61c6817351e4) dependency, while keep `D2 (https://github.com/facebookresearch/d2go/commit/d86ecc92eb97f14fcd97d626185f61c6817351e4)TorchscriptTracingExport` in D2 (https://github.com/facebookresearch/d2go/commit/d86ecc92eb97f14fcd97d626185f61c6817351e4)Go as a more advanced version. - Using `D2 (https://github.com/facebookresearch/d2go/commit/d86ecc92eb97f14fcd97d626185f61c6817351e4)TorchscriptTracingExport` we can simply the `prepare_for_export` quite a bit and remove hacky code. Reviewed By: zhanghang1989 Differential Revision: D27931029 fbshipit-source-id: 4a8d5e5ee3f10e29d98fca63e0e1c68bbda22745
12468504