[Vulkan] Generalize GLU along channel dim to support input of any even channel size. (#81729)
Summary:
Extended previous implementation of GLU, to support input of any even channel size (i.e. output tensor of any channel size)
This is still a special case implementation of GLU:
- Input tensor must be 4-dim, i.e. [N, C, H, W].
- dim must be 1.
References
- PyTorch Docs > torch.nn > [GLU](https://pytorch.org/docs/stable/generated/torch.nn.GLU.html)
Test Plan:
Added test cases to `/xplat/caffe2/aten/src/ATen/test/vulkan_api_test.cpp`
On Mac:
```
buck run //xplat/caffe2:pt_vulkan_api_test_binAppleMac
```
On Android:
```
buck build -c ndk.custom_libcxx=false -c pt.enable_qpl=0 //xplat/caffe2:pt_vulkan_api_test_binAndroid\#android-arm64 --show-output
adb push buck-out/gen/xplat/caffe2/pt_vulkan_api_test_binAndroid\#android-arm64 /data/local/tmp/vulkan_api_test
adb shell "/data/local/tmp/vulkan_api_test"
Reviewed By: SS-JIA
Differential Revision: D37958364
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81729
Approved by: https://github.com/SS-JIA