Skip to content

Commit 6e6d24e

Browse files
authored
Allocate 1d results of correct size (#577)
Before, it was erroneously allocated as a 1-element array instead of a 6-element array in the test case. Closes #574
1 parent 7124eaa commit 6e6d24e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

code/numpy/transform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ mp_obj_t transform_dot(mp_obj_t _m1, mp_obj_t _m2) {
380380
if(ndim == 2) { // matrix times matrix -> matrix
381381
shape = ndarray_shape_vector(0, 0, shape1, shape2);
382382
} else { // matrix times vector -> vector, vector times vector -> vector (size 1)
383-
shape = ndarray_shape_vector(0, 0, 0, shape1);
383+
shape = ndarray_shape_vector(0, 0, 0, shape1 * shape2);
384384
}
385385
ndarray_obj_t *results = ndarray_new_dense_ndarray(ndim, shape, NDARRAY_FLOAT);
386386
mp_float_t *rarray = (mp_float_t *)results->array;

0 commit comments

Comments
 (0)