[Caffe2] Use more irange()s in loops. (#72264)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72264
Using an explicitly typed loop variable risks type mismatches with the loop
bound; using an const auto variable and c10::irange eliminates this
possibility. This change modifies loops in files under
fbsource/fbcode/caffe2/aten from the format
`for(TYPE var=x0;var<x_max;x++)` to `for(const auto var: irange(xmax))`
This was achieved by running r-barnes's loop upgrader script (D28874212)
modified for the appropriate directory.
Test Plan: arc sanity
Reviewed By: r-barnes
Differential Revision: D33952436
fbshipit-source-id: aa89946bff4681f20ed0fa6a59ed640e0972a947
(cherry picked from commit 5ca0b25834011fa499cd71685dd5e5c7656b1f9b)