Fix indexing for overrides. (#49324)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/46277
Pull Request resolved: https://github.com/pytorch/pytorch/pull/49324
Reviewed By: mruberry
Differential Revision: D25959334
Pulled By: ezyang
fbshipit-source-id: bac48b8ffee89d10aa04c004de2b53b4e54a96c2