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