summaryrefslogtreecommitdiff
path: root/numpy/core/src/umath
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2018-05-30 11:45:52 -0700
committerGitHub <noreply@github.com>2018-05-30 11:45:52 -0700
commit9e2dd688acffbe949cfd615f43cb79fa3ceeb231 (patch)
tree3f8b46496f8ec73833db74b0517938261996ff3f /numpy/core/src/umath
parent896393b7d14415a654f1d196b0c5e9c678218fc0 (diff)
parenteb8f8514e2ac95f11efd5368ed94adeee3f73277 (diff)
downloadnumpy-9e2dd688acffbe949cfd615f43cb79fa3ceeb231.tar.gz
Merge pull request #11176 from mhvk/gufunc-keepdims-iter-alloc
MAINT: avoid setting non-existing gufunc strides for keepdims=True.
Diffstat (limited to 'numpy/core/src/umath')
-rw-r--r--numpy/core/src/umath/ufunc_object.c4
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