diff --git a/src/csrc/umath/comparison_ops.cpp b/src/csrc/umath/comparison_ops.cpp index f9a0539..92d675b 100644 --- a/src/csrc/umath/comparison_ops.cpp +++ b/src/csrc/umath/comparison_ops.cpp @@ -288,16 +288,7 @@ NPY_NO_EXPORT int comparison_ufunc_promoter(PyObject *ufunc_obj, PyArray_DTypeMeta *const op_dtypes[], PyArray_DTypeMeta *const signature[], PyArray_DTypeMeta *new_op_dtypes[]) { - // Reduction: accumulator is Bool, element is QuadPrecDType, output is Bool - if (op_dtypes[0] == NULL) { - Py_INCREF(&PyArray_BoolDType); - new_op_dtypes[0] = &PyArray_BoolDType; - Py_INCREF(op_dtypes[1]); - new_op_dtypes[1] = op_dtypes[1]; - Py_INCREF(&PyArray_BoolDType); - new_op_dtypes[2] = &PyArray_BoolDType; - return 0; - } + assert(op_dtypes[0] != NULL); PyUFuncObject *ufunc = (PyUFuncObject *)ufunc_obj; if (quad_ufunc_has_object_input(ufunc, op_dtypes)) { diff --git a/src/include/umath/promoters.hpp b/src/include/umath/promoters.hpp index 2f41bb5..b049a58 100644 --- a/src/include/umath/promoters.hpp +++ b/src/include/umath/promoters.hpp @@ -39,15 +39,7 @@ quad_ufunc_promoter(PyObject *ufunc_obj, PyArray_DTypeMeta *const op_dtypes[], PyUFuncObject *ufunc = (PyUFuncObject *)ufunc_obj; int nargs = ufunc->nargs; - // Handle the special case for reductions - if (op_dtypes[0] == NULL) { - assert(ufunc->nin == 2 && ufunc->nout == 1); /* must be reduction */ - for (int i = 0; i < 3; i++) { - Py_INCREF(op_dtypes[1]); - new_op_dtypes[i] = op_dtypes[1]; - } - return 0; - } + assert(op_dtypes[0] != NULL); if (quad_ufunc_has_object_input(ufunc, op_dtypes)) { for (int i = 0; i < nargs; i++) {