[Pytorch Mobile] Only preserve bundled input helpers for forward if they exist (#51884)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51884
it is now possible to bundle inputs and not bundle them for forward. This is ok and so we need to account for that.
ghstack-source-id: 121266667
Test Plan: Manually bundle inputs for a function not named forward. Call optimize_for_mobile and make sure the functions are still there. {P173289878}
Reviewed By: iseeyuan
Differential Revision: D26304558
fbshipit-source-id: 79f82d9de59c70b76f34e01f3d691107bf40e7bc