pytorch/caffe2/python
Richard Barnes 1622546050 use irange for loops (#70248)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70248

Modified loops in files under fbsource/fbcode/caffe2/ from the format
```
for(TYPE var=x0;var<x_max;x++)
```
to the format
```
for(const auto var: irange(xmax))
```

This was achieved by running r-barnes's loop upgrader script (D28874212) with some modification to exclude all files under /torch/jit and a number of reversions or unused variable suppression warnings added by hand.

Test Plan: Sandcastle

Reviewed By: malfet

Differential Revision: D32813863

fbshipit-source-id: 527244b4a2b220fdfe7f17dee3599603f492a2ca
2022-01-06 23:14:29 -08:00
..
benchmarks
docs
examples
fakelowp
helpers
ideep
layers [itemwise-dropout][1/x][low-level module] Implement Itemwise Sparse Feature Dropout in Dper3 (#59322) 2021-06-04 19:59:17 -07:00
mint [typing] suppress errors in fbcode/caffe2 - batch 2 2021-07-21 17:56:26 -07:00
mkl
modeling
models
onnx Upgrade onnx submodule to 85546f8c44e627f8ff1181725d03cc49f675e44f (#66427) 2021-10-12 09:46:08 -07:00
operator_test [gpu ne eval] disable adam decay unit test for gpu (#66056) 2021-10-03 07:40:23 -07:00
predictor clear predict_net field from PredictorExporterMeta stored in the exporter to save memory (#68485) 2021-12-10 21:25:36 -08:00
rnn
serialized_test [typing] suppress errors in fbcode/caffe2 - batch 2 2021-08-10 10:26:52 -07:00
test
trt Fix pretrained=True for test_pt_onnx_trt (#67818) 2021-11-04 09:49:42 -07:00
__init__.py Revert D31172530: [pytorch][PR] Enable CUPTI for kineto by default on windows 2021-09-24 19:18:15 -07:00
_import_c_extension.py
_import_c_extension.pyi
allcompare_test.py Disallow versionless Python shebangs (#58275) 2021-05-14 08:26:02 -07:00
attention.py
benchmark_generator.py Disallow versionless Python shebangs (#58275) 2021-05-14 08:26:02 -07:00
binarysize.py
brew.py
brew_test.py
build.py
cached_reader.py
caffe_translator.py Remove unused python2 shebang (#58409) 2021-05-17 13:19:32 -07:00
caffe_translator_test.py
checkpoint.py
checkpoint_test.py
CMakeLists.txt
cnn.py
context.py
context.pyi
context_test.py
control.py
control_ops_grad.py
control_ops_grad_test.py
control_ops_util.py
control_test.py
convert.py
convert_test.py
convnet_benchmarks.py
convnet_benchmarks_test.py
core.py [easy] add an inplace argument to MutableNetProto.to_net() and core.Net() constructor (#63068) 2021-08-11 11:10:52 -07:00
core_gradients_test.py
core_test.py [easy] add an inplace argument to MutableNetProto.to_net() and core.Net() constructor (#63068) 2021-08-11 11:10:52 -07:00
crf.py
crf_predict.py
crf_viterbi_test.py
data_parallel_model.py
data_parallel_model_test.py
data_workers.py
data_workers_test.py
dataio.py
dataio_test.py
dataset.py
db_file_reader.py
db_test.py
device_checker.py
dlpack.h [NOOP][clangformat][codemod] Enable CLANGFORMAT for caffe2/caffe2/* (#67624) 2021-11-02 22:14:04 -07:00
dyndep.py
embedding_generation_benchmark.py
experiment_util.py
extension_loader.py
fakefp16_transform_lib.py
filler_test.py
functional.py
functional_test.py
fused_8bit_rowwise_conversion_ops_test.py
gradient_check_test.py
gradient_checker.py
gru_cell.py
hip_test_util.py
hsm_util.py
hypothesis_test.py
hypothesis_test_util.py
ideep_test_util.py
layer_model_helper.py
layer_model_instantiator.py
layer_parameter_sharing_test.py
layer_test_util.py
layers_test.py [itemwise-dropout][1/x][low-level module] Implement Itemwise Sparse Feature Dropout in Dper3 (#59322) 2021-06-04 19:59:17 -07:00
lazy.py
lazy_dyndep.py
lazy_dyndep_test.py Disallow versionless Python shebangs (#58275) 2021-05-14 08:26:02 -07:00
lengths_reducer_fused_8bit_rowwise_ops_test.py
lengths_reducer_rowwise_8bit_ops_test.py
lstm_benchmark.py
memonger.py
memonger_test.py
mkl_test_util.py
model_device_test.py
model_helper.py
model_helper_test.py
modifier_context.py
mpi_python.cc
muji.py
muji_test.py
net_builder.py
net_builder_test.py
net_drawer.py
net_printer.py
net_printer_test.py
nomnigraph.py
nomnigraph_test.py
nomnigraph_transformations.py
nomnigraph_transformations_test.py
normalizer.py
normalizer_context.py
normalizer_test.py
numa_benchmark.py
numa_test.py
observer_test.py
operator_fp_exceptions_test.py
optimizer.py [RFC] Reduce logging noise from AdagradOptimizer (#66443) 2021-10-11 13:25:41 -07:00
optimizer_context.py
optimizer_test.py Smart Decay for Adam - DPER3 (#62058) 2021-07-23 13:26:30 -07:00
optimizer_test_util.py
parallel_workers.py
parallel_workers_test.py
parallelize_bmuf_distributed_test.py
pipeline.py
pipeline_test.py
predictor_constants.py
pybind_state.cc [ROCm] Changes not to rely on CUDA_VERSION or HIP_VERSION (#65610) 2021-09-29 09:55:43 -07:00
pybind_state.h use irange for loops (#70248) 2022-01-06 23:14:29 -08:00
pybind_state_dlpack.cc
pybind_state_dlpack.h [NOOP][clangformat][codemod] Enable CLANGFORMAT for caffe2/caffe2/* (#67624) 2021-11-02 22:14:04 -07:00
pybind_state_gpu.cc [NOOP][clangformat][codemod] Enable CLANGFORMAT for caffe2/caffe2/* (#67624) 2021-11-02 22:14:04 -07:00
pybind_state_hip.cc [NOOP][clangformat][codemod] Enable CLANGFORMAT for caffe2/caffe2/* (#67624) 2021-11-02 22:14:04 -07:00
pybind_state_ideep.cc [NOOP][clangformat][codemod] Enable CLANGFORMAT for caffe2/caffe2/* (#67624) 2021-11-02 22:14:04 -07:00
pybind_state_int8.cc Disable avoid-non-const-global-variables lint check (#62008) 2021-07-22 18:04:40 -07:00
pybind_state_nomni.cc [NOOP][clangformat][codemod] Enable CLANGFORMAT for caffe2/caffe2/* (#67624) 2021-11-02 22:14:04 -07:00
pybind_state_registry.cc Disable avoid-non-const-global-variables lint check (#62008) 2021-07-22 18:04:40 -07:00
pybind_state_registry.h
python_op_test.py
queue_util.py
record_queue.py
recurrent.py
regularizer.py
regularizer_context.py
regularizer_test.py
rnn_cell.py
schema.py
schema_test.py
scope.py
scope_test.py
session.py
session_test.py
sparse_to_dense_mask_test.py
sparse_to_dense_test.py
task.py
task_test.py
test_util.py
text_file_reader.py
timeout_guard.py
toy_regression_test.py
transformations.py
transformations_test.py
tt_core.py
tt_core_test.py
utils.py
utils_test.py
visualize.py
workspace.py
workspace_test.py Fix bytes_written and bytes_read (#64244) 2021-09-01 13:35:41 -07:00