diff options
author | mattip <matti.picus@gmail.com> | 2018-12-05 16:47:06 -0800 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2018-12-05 16:47:06 -0800 |
commit | f7a9fac9031a4e6f2f6ec5c5093c9f754bcd7128 (patch) | |
tree | bdddf672edc01de6a8b9600998cac8ac84dff541 /numpy/core/src/common | |
parent | 8a115731966db1d723d03b4b599a5f3587edc94b (diff) | |
download | numpy-f7a9fac9031a4e6f2f6ec5c5093c9f754bcd7128.tar.gz |
BUG: test, fix matmul, dot for vector array with stride[i]=0
Diffstat (limited to 'numpy/core/src/common')
-rw-r--r-- | numpy/core/src/common/cblasfuncs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/core/src/common/cblasfuncs.c b/numpy/core/src/common/cblasfuncs.c index 64a0569ad..c46843d63 100644 --- a/numpy/core/src/common/cblasfuncs.c +++ b/numpy/core/src/common/cblasfuncs.c @@ -188,6 +188,7 @@ _bad_strides(PyArrayObject *ap) int itemsize = PyArray_ITEMSIZE(ap); int i, N=PyArray_NDIM(ap); npy_intp *strides = PyArray_STRIDES(ap); + npy_intp *dims = PyArray_DIMS(ap); if (((npy_intp)(PyArray_DATA(ap)) % itemsize) != 0) { return 1; @@ -196,6 +197,9 @@ _bad_strides(PyArrayObject *ap) if ((strides[i] < 0) || (strides[i] % itemsize) != 0) { return 1; } + if ((strides[i] == 0 && dims[i] >1)) { + return 1; + } } return 0; |