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

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

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