[caffe2] fix -Wrange-loop-construct
Test Plan:
```
% jf get -u D27943111
% buck build mode/dev-nosan admarket/adfinder:adfinder admarket/adindexer:adindexer \
-c cxx.extra_cxxflags='-Wno-implicit-const-int-float-conversion -Wno-sign-compare -Wno-deprecated-copy -Wno-deprecated-declarations -Wno-pass-failed' \
-c cxx.compiler_variant=clang-12 \
-c cxx.modules=false
```
Reviewed By: hlu1
Differential Revision: D27988238
fbshipit-source-id: 304e44bfa141a1bcb291f9434fed514bbb568f8f