Replace all uses of AT_INDEX_ERROR with TORCH_CHECK_INDEX (#35050)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/35050
Differential Revision: D20550978
Pulled By: ezyang
fbshipit-source-id: df7c0730f27d2986601b1dee17e41957be2956de