summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2021-12-04 13:51:49 -0600
committerSebastian Berg <sebastian@sipsolutions.net>2021-12-04 13:51:49 -0600
commite76052fc852e957f141c2c8090a59753f163a0b8 (patch)
tree39b8d0437642bb6f757fe65909f670423f3998ed
parent5b615c49f5880b464f3b24136bc08345be1924ae (diff)
downloadnumpy-e76052fc852e957f141c2c8090a59753f163a0b8.tar.gz
MAINT: Remove now unnecessary/bogus reduce special path
-rw-r--r--numpy/core/src/umath/dispatching.c29
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);
- }
}
/*