From c3fafa497c016303ef5f861d70ff3947111d2da8 Mon Sep 17 00:00:00 2001 From: Mark Wiebe Date: Fri, 19 Aug 2011 16:47:07 -0700 Subject: [PATCH] BUG: ufunc: Missed a small update for the unitless reduction case --- numpy/core/src/multiarray/reduction.h | 2 +- numpy/core/src/umath/ufunc_object.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/numpy/core/src/multiarray/reduction.h b/numpy/core/src/multiarray/reduction.h index 9de44de61b81..761497be126f 100644 --- a/numpy/core/src/multiarray/reduction.h +++ b/numpy/core/src/multiarray/reduction.h @@ -43,7 +43,7 @@ typedef int (PyArray_AssignReduceUnitFunc)(PyArrayObject *result, * npy_intp count = *countptr; * * // Skip any first-visit elements - * if (NpyIter_IsFirstVisit(iter, 1)) { + * if (NpyIter_IsFirstVisit(iter, 0)) { * if (stride0 == 0) { * --count; * --skip_first_count; diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index a86c67c2d288..643e1d6f0822 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -2881,7 +2881,7 @@ PyUFunc_Reduce(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *out, npy_intp count = *count_ptr; /* Skip any first-visit elements */ - if (NpyIter_IsFirstVisit(iter, 1)) { + if (NpyIter_IsFirstVisit(iter, 0)) { if (stride[0] == 0) { --count; --skip_first_count; @@ -2933,7 +2933,7 @@ PyUFunc_Reduce(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *out, npy_intp count = *count_ptr; /* Skip any first-visit elements */ - if (NpyIter_IsFirstVisit(iter, 1)) { + if (NpyIter_IsFirstVisit(iter, 0)) { if (stride[0] == 0) { --count; --skip_first_count;