diff options
author | Marten van Kerkwijk <mhvk@astro.utoronto.ca> | 2018-05-28 08:38:39 -0400 |
---|---|---|
committer | Marten van Kerkwijk <mhvk@astro.utoronto.ca> | 2018-05-28 08:39:01 -0400 |
commit | eb8f8514e2ac95f11efd5368ed94adeee3f73277 (patch) | |
tree | a3fee203e8aa72ec2e35498b12f37a650457745f /numpy/core/src/umath | |
parent | 69458b02956d39082014573eb0350ae3eb3436ee (diff) | |
download | numpy-eb8f8514e2ac95f11efd5368ed94adeee3f73277.tar.gz |
MAINT: avoid setting non-existing gufunc strides for keepdims=True.
Corrects an overzealous change from the fixed core dimensions
to the ones expanded for keepdims=True.
Diffstat (limited to 'numpy/core/src/umath')
-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 af415362b..7548ffb87 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -2538,7 +2538,7 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc, */ core_dim_ixs_size = 0; for (i = 0; i < nop; ++i) { - core_dim_ixs_size += core_num_dims[i]; + core_dim_ixs_size += ufunc->core_num_dims[i]; } inner_strides = (npy_intp *)PyArray_malloc( NPY_SIZEOF_INTP * (nop+core_dim_ixs_size)); @@ -2550,7 +2550,7 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc, /* Copy the strides after the first nop */ idim = nop; for (i = 0; i < nop; ++i) { - int num_dims = core_num_dims[i]; + int num_dims = ufunc->core_num_dims[i]; int core_start_dim = PyArray_NDIM(op[i]) - num_dims; /* * Need to use the arrays in the iterator, not op, because |