[Vulkan] Fix incorrect input range for Hardshrink tests (#63515)
authorSangbaek Park <sangbaek@fb.com>
Wed, 18 Aug 2021 22:50:33 +0000 (15:50 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 18 Aug 2021 22:52:12 +0000 (15:52 -0700)
commit1f4e019d8e8b00d004ca02d17cede0c7aec9f92d
tree8714b4016d7512607c67a6822ef9d8fee19df927
parent15eec8e1d1ea5b3354bc305f1afe0c01a64ea748
[Vulkan] Fix incorrect input range for Hardshrink tests (#63515)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63515

Fixed inappropriate input range for Hardshrink tests:
The range -10 ~ +10 for input tensors is more proper when we use the test set of lambda {-4.2, -1.0, -0.42, 0.0, 0.42, 1.0, 4.2, 42.42}.
ghstack-source-id: 136141416

Test Plan:
```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"
```
Note that the test can fail sporadically due to the precision loss by FP16(Vulkan)/FP32(CPU). This issue will be handled separately after some design discussions.

Reviewed By: SS-JIA

Differential Revision: D30389646

fbshipit-source-id: 7224bd8ba4e4972f5fc147df8a0cb84808f8c62e
aten/src/ATen/test/vulkan_api_test.cpp