[pytorch] codegen flags to whitelist op registrations / generate to separate files (#32451)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/32451
This PR adds a few new parameters to ATen codegen script:
```
1. op_registration_whitelist
Can be used to filter op registrations for selective build;
2. type_whitelist
Can be used to filter types (CPUType, CUDAType, ...) for selective build;
3. per_op_registration
When set it will group function registrations by op name and write to separate files;
```
1 & 2 are introduced for mobile custom build without relying on static dispatch;
3 is introduced to solve custom build with multi-library / multi-model (needed by FB
internal build - see more details: https://fb.quip.com/ZVh1AgOKW8Vv).
These flags should work independently with each other (and independent to USE_STATIC_DISPATCH).
Not setting them should have no effect compared to master.
ghstack-source-id: 97214788
Test Plan: - tested all 3 params with FB internal build changes.
Differential Revision: D19427919
fbshipit-source-id: a381fe5f768fe2e9196563787f08eb9f18316e83