Skip to content

Commit 7de1d09

Browse files
committed
fixed small glitch in all/any
1 parent 8046888 commit 7de1d09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

code/numpy/numerical/numerical.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static mp_obj_t numerical_all_any(mp_obj_t oin, mp_obj_t axis, uint8_t optype) {
7575
uint8_t *rarray = NULL;
7676
shape_strides _shape_strides = tools_reduce_axes(ndarray, axis);
7777
if(axis != mp_const_none) {
78-
results = ndarray_new_dense_ndarray(MAX(1, ndarray->ndim-1), _shape_strides.shape, NDARRAY_BOOL);
78+
results = ndarray_new_dense_ndarray(_shape_strides.ndim, _shape_strides.shape, NDARRAY_BOOL);
7979
rarray = results->array;
8080
if(optype == NUMERICAL_ALL) {
8181
memset(rarray, 1, results->len);
@@ -129,7 +129,7 @@ static mp_obj_t numerical_all_any(mp_obj_t oin, mp_obj_t axis, uint8_t optype) {
129129
} while(l < _shape_strides.shape[0]);
130130
}
131131
#if ULAB_MAX_DIMS > 1
132-
rarray++;
132+
rarray += _shape_strides.increment;
133133
array -= _shape_strides.strides[0] * _shape_strides.shape[0];
134134
array += _shape_strides.strides[ULAB_MAX_DIMS - 1];
135135
k++;

0 commit comments

Comments
 (0)