[pytorch] aten codegen to filter backends for default mobile build
Summary:
This is a simple change to mitigate the OSS mobile default build size regression caused by #34275 and #34622.
Mobile supported backends are already kinda hard-coded in function_wrapper.py as `static_dispatch_backends`:
https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/function_wrapper.py#L243
This is simply to align dynamic registration with static dispatch for mobile build.
To measure mobile build size:
```
// Default mobile build:
scripts/build_pytorch_android.sh armeabi-v7a
// MobileNetV2 custom build:
SELECTED_OP_LIST=MobileNetV2.yaml scripts/build_pytorch_android.sh armeabi-v7a
```
- arm-v7 Android AAR (compressed) size:
```
+----------+-------------------+---------------+
| | MobileNetV2 Build | Default Build |
+----------+-------------------+---------------+
| Original | 3,354,589 | 5,731,992 |
| #34275 | 3,404,978 | 6,640,526 |
| #34622 | 3,432,569 | 6,640,526 |
| This PR | 3,431,660 | 6,534,135 |
+----------+-------------------+---------------+
```
Differential Revision: D20415107
Test Plan: Imported from OSS
Pulled By: ljk53
fbshipit-source-id: 75acf4dc5dfe9242c01b2db0b84bd6b4a1d0cd8d