Use direct vector indexing in Object::getSlot() instead of at(). (#31627)
Summary:
This method is pretty hot. In an internal workload, this single
call to at() accounted for ~2% of overall cycles.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/31627
Reviewed By: yinghai
Differential Revision: D19607779
Pulled By: qizzzh
fbshipit-source-id: 1684919049a35fdad686d8396c7dce7243ab92d4