[PyTorch Mobile] Restructure DispatchStub::operator() code to move template independent code into an external method (#51403)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51403
Turns out this isn't a new idea. swolchok posted about this a while ago and this was discussed in the composability group.
Links to posts:
* Template Hoisting: https://fb.workplace.com/groups/llvm.gcc/permalink/2321250667923535/
* C++: Most of the code in a template should depend on the template parameter(s): https://fb.workplace.com/groups/2088132188069398/permalink/2224983771050905/
ghstack-source-id: 121873716
Test Plan: Results in a 10KiB size reduction on fbios. Will re-run BSB for igios.
Reviewed By: swolchok
Differential Revision: D25859327
fbshipit-source-id: 915abebb2643f8ac9a901f3b4d79c63f4bbb5fee