Update to replace AT_ERROR with TORCH_CHECK (#52711)
Summary:
Fixes #{52699}
Pull Request resolved: https://github.com/pytorch/pytorch/pull/52711
Reviewed By: ailzhang
Differential Revision: D26654677
Pulled By: malfet
fbshipit-source-id: 97079250d144c9b1c69028f35e4a23a34481b2a5