Add static dispatch mode to reduce mobile code size
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/22335
Test Plan: Imported from OSS
Differential Revision: D16048264
Pulled By: li-roy
fbshipit-source-id: ad1e50951273962a51bac7c25c3d2e5a588a730e