未验证 提交 ae93930f 编写于 作者: G gouzil 提交者: GitHub

[clang-tidy] NO.3 supplement modernize-redundant-void-arg (#55741)

上级 26331724
......@@ -493,9 +493,7 @@ EagerReducer::EagerReducer(
for (size_t global_var_index = 0; global_var_index < tensors_.size();
++global_var_index) {
auto tensor = tensors_[global_var_index];
auto reduce_hook = [=](void) -> void {
this->AddDistHook(global_var_index);
};
auto reduce_hook = [=]() -> void { this->AddDistHook(global_var_index); };
const auto &grad_node = GetGradNodeFromTensor(&tensor);
......
......@@ -1276,19 +1276,19 @@ static PyObject* eager_api_set_master_grads(PyObject* self,
PyMethodDef variable_functions[] = {
// TODO(jiabin): Remove scale when we have final state tests
{"scale",
(PyCFunction)(void (*)(void))eager_api_scale,
(PyCFunction)(void (*)())eager_api_scale,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"_add_backward_final_hook",
(PyCFunction)(void (*)(void))eager_api__add_backward_final_hook,
(PyCFunction)(void (*)())eager_api__add_backward_final_hook,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"run_backward",
(PyCFunction)(void (*)(void))eager_api_run_backward,
(PyCFunction)(void (*)())eager_api_run_backward,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"run_partial_grad",
(PyCFunction)(void (*)(void))eager_api_run_partial_grad,
(PyCFunction)(void (*)())eager_api_run_partial_grad,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"_get_custom_operator_inplace_map",
......@@ -1297,67 +1297,67 @@ PyMethodDef variable_functions[] = {
METH_VARARGS | METH_KEYWORDS,
NULL},
{"_run_custom_op",
(PyCFunction)(void (*)(void))eager_api_run_custom_op,
(PyCFunction)(void (*)())eager_api_run_custom_op,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"tensor_copy",
(PyCFunction)(void (*)(void))eager_api_tensor_copy,
(PyCFunction)(void (*)())eager_api_tensor_copy,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"get_all_grads",
(PyCFunction)(void (*)(void))eager_api_get_all_grads,
(PyCFunction)(void (*)())eager_api_get_all_grads,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"get_grads_lists",
(PyCFunction)(void (*)(void))eager_api_get_grads_lists,
(PyCFunction)(void (*)())eager_api_get_grads_lists,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"get_grads_types",
(PyCFunction)(void (*)(void))eager_api_get_grads_types,
(PyCFunction)(void (*)())eager_api_get_grads_types,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"read_next_tensor_list",
(PyCFunction)(void (*)(void))eager_api_read_next_tensor_list,
(PyCFunction)(void (*)())eager_api_read_next_tensor_list,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"jit_function_call",
(PyCFunction)(void (*)(void))eager_api_jit_function_call,
(PyCFunction)(void (*)())eager_api_jit_function_call,
METH_VARARGS | METH_KEYWORDS,
NULL},
/**sparse functions**/
{"sparse_coo_tensor",
(PyCFunction)(void (*)(void))eager_api_sparse_coo_tensor,
(PyCFunction)(void (*)())eager_api_sparse_coo_tensor,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"sparse_csr_tensor",
(PyCFunction)(void (*)(void))eager_api_sparse_csr_tensor,
(PyCFunction)(void (*)())eager_api_sparse_csr_tensor,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"register_saved_tensors_hooks",
(PyCFunction)(void (*)(void))eager_api_register_saved_tensors_hooks,
(PyCFunction)(void (*)())eager_api_register_saved_tensors_hooks,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"reset_saved_tensors_hooks",
(PyCFunction)(void (*)(void))eager_api_reset_saved_tensors_hooks,
(PyCFunction)(void (*)())eager_api_reset_saved_tensors_hooks,
METH_VARARGS | METH_KEYWORDS,
NULL},
/**amp functions**/
{"set_master_grads",
(PyCFunction)(void (*)(void))eager_api_set_master_grads,
(PyCFunction)(void (*)())eager_api_set_master_grads,
METH_VARARGS | METH_KEYWORDS,
NULL},
/**sparse functions**/
#if defined(PADDLE_WITH_CUDA)
{"async_read",
(PyCFunction)(void (*)(void))eager_api_async_read,
(PyCFunction)(void (*)())eager_api_async_read,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"async_write",
(PyCFunction)(void (*)(void))eager_api_async_write,
(PyCFunction)(void (*)())eager_api_async_write,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"to_uva_tensor",
(PyCFunction)(void (*)(void))eager_api_to_uva_tensor,
(PyCFunction)(void (*)())eager_api_to_uva_tensor,
METH_VARARGS | METH_KEYWORDS,
NULL},
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册