Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

【Hackathon 6th Fundable Projects 2 No.33】modernize-redundant-void-arg-final #63795

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions paddle/fluid/framework/hogwild_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class GPUParallelCopyer {
++copy_count_;
}
}
void Wait(void) {
void Wait() {
if (copy_count_ == 0) {
return;
}
Expand All @@ -142,7 +142,7 @@ class GPUParallelCopyer {
}
copy_count_ = 0;
}
void SyncDevStream(void) { platform::GpuStreamSync(dev_stream_); }
void SyncDevStream() { platform::GpuStreamSync(dev_stream_); }

private:
phi::gpuStream_t dev_stream_ = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/multi_trainer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void MultiTrainer::MergeToRootScope(phi::DenseTensor* root_tensor,
}
TensorCopy(tmp_root, platform::CPUPlace(), root_tensor);
}
void MultiTrainer::MergeWorkerVars(void) {
void MultiTrainer::MergeWorkerVars() {
for (size_t i = 0; i < need_merge_var_names_.size(); i++) {
Variable* root_var = root_scope_->FindVar(need_merge_var_names_[i]);
if (root_var == nullptr) {
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/pybind/eager_functions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1380,8 +1380,8 @@ PyMethodDef variable_functions[] = { // NOLINT
METH_VARARGS | METH_KEYWORDS,
nullptr},
{"_get_custom_operator_inplace_map",
(PyCFunction)(void (*)(
void))eager_api__get_custom_operator_inplace_reverse_idx,
(PyCFunction)(void (*)())
eager_api__get_custom_operator_inplace_reverse_idx,
METH_VARARGS | METH_KEYWORDS,
nullptr},
{"_run_custom_op",
Expand Down
16 changes: 7 additions & 9 deletions paddle/fluid/pybind/eager_method.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3233,8 +3233,7 @@ PyMethodDef variable_methods[] = { // NOLINT
METH_VARARGS | METH_KEYWORDS,
nullptr},
{"_is_dense_tensor_hold_allocation",
(PyCFunction)(void (*)(
void))tensor_method__is_dense_tensor_hold_allocation,
(PyCFunction)(void (*)())tensor_method__is_dense_tensor_hold_allocation,
METH_VARARGS | METH_KEYWORDS,
nullptr},
{"_copy_to",
Expand Down Expand Up @@ -3298,7 +3297,7 @@ PyMethodDef variable_methods[] = { // NOLINT
METH_VARARGS | METH_KEYWORDS,
tensor_method_detach__doc__},
{"detach_",
(PyCFunction)(void (*)(void))tensor_method_detach_,
(PyCFunction)(void (*)())tensor_method_detach_,
METH_VARARGS | METH_KEYWORDS,
tensor_method_detach___doc__},
{"get_tensor",
Expand Down Expand Up @@ -3481,19 +3480,19 @@ PyMethodDef variable_methods[] = { // NOLINT
METH_VARARGS | METH_KEYWORDS,
nullptr},
{"contiguous",
(PyCFunction)(void (*)(void))tensor_contiguous,
(PyCFunction)(void (*)())tensor_contiguous,
METH_VARARGS | METH_KEYWORDS,
tensor_contiguous__doc__},
{"is_contiguous",
(PyCFunction)(void (*)(void))tensor_is_contiguous,
(PyCFunction)(void (*)())tensor_is_contiguous,
METH_VARARGS | METH_KEYWORDS,
tensor_is_contiguous__doc__},
{"get_strides",
(PyCFunction)(void (*)(void))tensor_method_strides,
(PyCFunction)(void (*)())tensor_method_strides,
METH_VARARGS | METH_KEYWORDS,
tensor_get_strides__doc__},
{"_set_impl",
(PyCFunction)(void (*)(void))tensor_method__set_impl,
(PyCFunction)(void (*)())tensor_method__set_impl,
METH_VARARGS | METH_KEYWORDS,
nullptr},
#if defined(PADDLE_WITH_CUDA)
Expand All @@ -3516,8 +3515,7 @@ PyMethodDef string_tensor_variable_methods[] = {
METH_VARARGS | METH_KEYWORDS,
nullptr},
{"_is_string_tensor_hold_allocation",
(PyCFunction)(void (*)(
void))tensor_method__is_string_tensor_hold_allocation,
(PyCFunction)(void (*)())tensor_method__is_string_tensor_hold_allocation,
METH_VARARGS | METH_KEYWORDS,
nullptr},
// TODO(zhoushunjie): Need to add _copy_to, copy_ for StringTensor.
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/pybind/eager_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2803,11 +2803,11 @@ void DistTensorConverter::operator()(paddle::optional<std::vector<Tensor>>* x) {

static PyMethodDef EagerUtilMethods[] = {
{"create_empty_tensors_with_var_descs",
(PyCFunction)(void (*)(void))GetEmptyTensorsWithVarDesc,
(PyCFunction)(void (*)())GetEmptyTensorsWithVarDesc,
METH_VARARGS,
"GetEmptyTensorsWithVarDesc"},
{"create_empty_tensors_with_values",
(PyCFunction)(void (*)(void))GetEmptyTensorsWithValue,
(PyCFunction)(void (*)())GetEmptyTensorsWithValue,
METH_VARARGS,
"GetEmptyTensorsWithValue."},
{"set_static_op_arg_pre_cast_hook",
Expand Down