pytorch
2ea50319 - [Caffe2] Use more irange()s in loops. (#72265)

Commit
2 years ago
[Caffe2] Use more irange()s in loops. (#72265) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/72265 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: D33952433 fbshipit-source-id: fea84c186257d070faceb83eb5900d6b2f49c13d (cherry picked from commit 7013bf0cc25f776fcabe600a9807f4192a246a53)
Author
Committer
Parents
Loading