TensorAccessor::bounds_check should be a CPU-only funciton (#62628)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62628
This fixes following errors when ROCm compiler is used
```
caffe2/aten/src/ATen/core/TensorAccessor.h:160:5: error: throw is prohibited in AMP-restricted functions
TORCH_CHECK_INDEX(
^
```
Test Plan: CI
Reviewed By: zhouzhuojie, seemethere
Differential Revision: D30059737
fbshipit-source-id: d094ee608768db41fcc91d044c2c6d7d29f33fe4