Skip to content

Commit b5a76ef

Browse files
committed
BUG: Fix unsupplied DType path in dispatching
This did not actually trigger any problems, probably because the reduce fallback mode later just catches it anyway... On the upside, this probably fixes most of the caching issues ;)
1 parent b2c2d19 commit b5a76ef

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

numpy/core/src/umath/dispatching.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,6 @@ resolve_implementation_info(PyUFuncObject *ufunc,
254254
for (Py_ssize_t i = 0; i < nargs; i++) {
255255
int best;
256256

257-
/* Whether this (normally output) dtype was specified at all */
258-
npy_bool is_not_specified = (
259-
op_dtypes[i] == (PyArray_DTypeMeta *)Py_None);
260-
261257
PyObject *prev_dtype = PyTuple_GET_ITEM(best_dtypes, i);
262258
PyObject *new_dtype = PyTuple_GET_ITEM(curr_dtypes, i);
263259

@@ -271,7 +267,8 @@ resolve_implementation_info(PyUFuncObject *ufunc,
271267
* the subclass should be considered a better match
272268
* (subclasses are always more specific).
273269
*/
274-
if (is_not_specified) {
270+
/* Whether this (normally output) dtype was specified at all */
271+
if (op_dtypes[i] == NULL) {
275272
/*
276273
* When DType is completely unspecified, prefer abstract
277274
* over concrete, assuming it will resolve.

0 commit comments

Comments
 (0)