mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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:
committed by
PyTorch MergeBot
parent
e7a4ad3b40
commit
b7f798caa4
@ -1581,8 +1581,7 @@ float BlockRunner::benchmark_model(
|
||||
|
||||
const bool is_kwargs_empty = kwargs_list.empty();
|
||||
const KeywordArgs empty_kwargs;
|
||||
for (const auto _n_run : c10::irange(warmup_runs)) {
|
||||
(void)_n_run; // Suppress unused variable warning
|
||||
for (C10_UNUSED const auto _n_run : c10::irange(warmup_runs)) {
|
||||
const auto num_args = static_cast<uint32_t>(args_list.size());
|
||||
for (const auto j : c10::irange(num_args)) {
|
||||
operator()(args_list[j], is_kwargs_empty ? empty_kwargs : kwargs_list[j]);
|
||||
@ -1592,8 +1591,7 @@ float BlockRunner::benchmark_model(
|
||||
}
|
||||
}
|
||||
caffe2::Timer timer;
|
||||
for (const auto _n_run : c10::irange(main_runs)) {
|
||||
(void)_n_run; // Suppress unused variable warning
|
||||
for (C10_UNUSED const auto _n_run : c10::irange(main_runs)) {
|
||||
const auto num_args = static_cast<uint32_t>(args_list.size());
|
||||
for (const auto j : c10::irange(num_args)) {
|
||||
operator()(args_list[j], is_kwargs_empty ? empty_kwargs : kwargs_list[j]);
|
||||
@ -1745,8 +1743,7 @@ BlockRunner::IndividualMetrics BlockRunner::benchmark_individual_ops(
|
||||
results.first_iter_time = timer.MilliSeconds();
|
||||
|
||||
// warmup runs
|
||||
for (const auto _n_run : c10::irange(warmup_runs)) {
|
||||
(void)_n_run; // Suppress unused variable warning
|
||||
for (C10_UNUSED const auto _n_run : c10::irange(warmup_runs)) {
|
||||
const auto num_args = static_cast<uint32_t>(args_list.size());
|
||||
for (const auto j : c10::irange(num_args)) {
|
||||
operator()(args_list[j], is_kwargs_empty ? empty_kwargs : kwargs_list[j]);
|
||||
@ -1757,8 +1754,7 @@ BlockRunner::IndividualMetrics BlockRunner::benchmark_individual_ops(
|
||||
}
|
||||
|
||||
// main runs
|
||||
for (const auto i : c10::irange(main_runs)) {
|
||||
(void)i; // Suppress unused variable warning
|
||||
for (C10_UNUSED const auto i : c10::irange(main_runs)) {
|
||||
const auto num_args = static_cast<uint32_t>(args_list.size());
|
||||
for (const auto j : c10::irange(num_args)) {
|
||||
set_inputs(args_list[j], is_kwargs_empty ? empty_kwargs : kwargs_list[j]);
|
||||
|
Reference in New Issue
Block a user