pytorch
4cca3935 - [Caffe2] Use more irange()s in loops. (#72270)

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