diff options
Diffstat (limited to 'numpy/core/src')
-rw-r--r-- | numpy/core/src/umath/ufunc_object.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index 290ed24a6..fce7d61de 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -1243,7 +1243,7 @@ try_trivial_single_output_loop(PyArrayMethod_Context *context, int op_ndim = PyArray_NDIM(op[iop]); /* Special case 0-D since we can handle broadcasting using a 0-stride */ - if (op_ndim == 0) { + if (op_ndim == 0 && iop < nin) { fixed_strides[iop] = 0; continue; } @@ -1254,7 +1254,7 @@ try_trivial_single_output_loop(PyArrayMethod_Context *context, operation_shape = PyArray_SHAPE(op[iop]); } else if (op_ndim != operation_ndim) { - return -2; /* dimension mismatch (except 0-d ops) */ + return -2; /* dimension mismatch (except 0-d input ops) */ } else if (!PyArray_CompareLists( operation_shape, PyArray_DIMS(op[iop]), op_ndim)) { |