[Caffe2] Use more irange()s in loops. (#72273)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72273
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: D33952432
fbshipit-source-id: a6c94c92f253fc44a456b6c1a3890c6b39c7bd6e
(cherry picked from commit e9568694bcd09a2152b9a785bc24746daa61ef0e)