[PyTorch] List::operator[] can return const ref for Tensor & string (#50083)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/50083
This should supercede D21966183 (https://github.com/pytorch/pytorch/commit/a371652bc85211a3967672bd0db5ece80f2ebae5)
(https://github.com/pytorch/pytorch/pull/39763) and D22830381 (https://github.com/pytorch/pytorch/commit/b44a10c1791f3f1d27171e6d012ca5f661e58aa9) as the way to get fast
access to the contents of a `torch::List`.
ghstack-source-id: 119675495
Reviewed By: smessmer
Differential Revision: D25776232
fbshipit-source-id: 81b4d649105ac9e08fc2c6563806f883809872f4