diff options
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/src/umath/dispatching.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/numpy/core/src/umath/dispatching.c b/numpy/core/src/umath/dispatching.c index 2504220e7..664288084 100644 --- a/numpy/core/src/umath/dispatching.c +++ b/numpy/core/src/umath/dispatching.c @@ -697,35 +697,6 @@ promote_and_get_info_and_ufuncimpl(PyUFuncObject *ufunc, } return info; } - else if (info == NULL && op_dtypes[0] == NULL) { - /* - * If we have a reduction, fill in the unspecified input/array - * assuming it should have the same dtype as the operand input - * (or the output one if given). - * Then, try again. In some cases, this will choose different - * paths, such as `ll->?` instead of an `??->?` loop for `np.equal` - * when the input is `.l->.` (`.` meaning undefined). This will - * then cause an error. But cast to `?` would always lose - * information, and in many cases important information: - * - * ```python - * from operator import eq - * from functools import reduce - * - * reduce(eq, [1, 2, 3]) != reduce(eq, [True, True, True]) - * ``` - * - * The special cases being `logical_(and|or|xor)` which can always - * cast to boolean ahead of time and still give the right answer - * (unsafe cast to bool is fine here). We special case these at - * the time of this comment (NumPy 1.21). - */ - assert(ufunc->nin == 2 && ufunc->nout == 1); - op_dtypes[0] = op_dtypes[2] != NULL ? op_dtypes[2] : op_dtypes[1]; - Py_INCREF(op_dtypes[0]); - return promote_and_get_info_and_ufuncimpl(ufunc, - ops, signature, op_dtypes, allow_legacy_promotion, 1); - } } /* |
