Fix issues with Werror=range-loop-construct (#83273)
Was seeing compilation issues introduced in ce8716f59 (https://github.com/pytorch/pytorch/pull/83177) in our internal
builds. Build errors look like:
```
fbcode/caffe2/aten/src/ATen/core/dispatch/DispatchKeyExtractor.h:145:23: error: loop variable 'tensor' creates a copy from type 'const at::Tensor' [-Werror=range-loop-construct]
145 | for (const at::Tensor tensor : ivalue.toTensorList()) {
|
```
see https://www.internalfb.com/diff/D38626007
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Fixes #ISSUE_NUMBER
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83273
Approved by: https://github.com/kit1980