Use C10_UNUSED instead of (void)X (#137239)

Summary:
Auto-generated with
```
buck run //scripts/rbarnes/regex_multiline_replacer:regex_multiline_replacer -- --find '^(\s*for\s*\()(const.*\n)\s*\(void\)[A-Za-z]+;\s*//\s*Suppress.*\s*\n(.*)'  --replace '\1C10_UNUSED \2\3' `find caffe2/ -regex ".*\.\(cpp\|h\)"`
```

Differential Revision: D33432600

Pull Request resolved: https://github.com/pytorch/pytorch/pull/137239
Approved by: https://github.com/Skylion007
This commit is contained in:
Richard Barnes
2024-10-15 14:32:59 +00:00
committed by PyTorch MergeBot
parent e7a4ad3b40
commit b7f798caa4
48 changed files with 90 additions and 143 deletions

View File

@ -157,8 +157,7 @@ void check_exact_values(
TEST(OptimTest, OptimizerAccessors) {
auto options = AdagradOptions(1.0);
std::vector<torch::Tensor> params;
for (const auto i : c10::irange(3)) {
(void)i; // Suppress unused variable warning
for (C10_UNUSED const auto i : c10::irange(3)) {
params.push_back(torch::randn(10));
}
auto optimizer = Adagrad(params, options);