diff --git a/paddle/fluid/pybind/op_function_common.cc b/paddle/fluid/pybind/op_function_common.cc index f92a0c7291fdab..c7d67532b09d9d 100644 --- a/paddle/fluid/pybind/op_function_common.cc +++ b/paddle/fluid/pybind/op_function_common.cc @@ -1559,8 +1559,8 @@ PyObject* GetItemFromArgsOrKWArgs(PyObject* args, return arg; } } else { - // get item from kwargs if kwargs has unused items - if (kwargs && *remaining_kwargs > 0) { + // get item from kwargs + if (kwargs) { PyObject* arg = nullptr; for (const std::string& keyword : keywords) { arg = PyDict_GetItemString(kwargs, keyword.c_str()); diff --git a/test/auto_parallel/test_api_dist_branch.py b/test/auto_parallel/test_api_dist_branch.py index c15f941c4aae7f..008067c56f3171 100644 --- a/test/auto_parallel/test_api_dist_branch.py +++ b/test/auto_parallel/test_api_dist_branch.py @@ -146,9 +146,6 @@ def test_bincount_api_for_dist_tensor(self): local_out = paddle.bincount(local_x, weights=local_weight) dist_out = paddle.bincount(dist_x, weights=dist_weight) - # add keywords usage case after fix code gen bug - # dist_out = paddle.bincount(dist_x, weights=dist_weight) - dist_out = paddle.bincount(dist_x, dist_weight) self.check_tensor_eq(local_out, dist_out)