Workaround the bug of TRT which creates extra outputs (#67327)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67327
At cerntain condition, TRT will create extra outputs, which seems more like a bug. If we don't capture those hidden outputs, we won't allocate memory to host those outputs and trt will end up writing to illegal memory. This diff address the issue but capturing the hidden outputs and allocate proper memory for them.
Reviewed By: jianyuh, wushirong, 842974287
Differential Revision: D31955379
fbshipit-source-id: c9faaf91ed45bec8e0bc4e0bea812a0a3f2abad0