diff --git a/code/ndarray.c b/code/ndarray.c index 0741edc4..45418be2 100644 --- a/code/ndarray.c +++ b/code/ndarray.c @@ -652,10 +652,10 @@ ndarray_obj_t *ndarray_new_ndarray_from_tuple(mp_obj_tuple_t *_shape, uint8_t dt // the function should work in the general n-dimensional case size_t *shape = m_new(size_t, ULAB_MAX_DIMS); for(size_t i=0; i < ULAB_MAX_DIMS; i++) { - if(i < ULAB_MAX_DIMS - _shape->len) { - shape[i] = 0; + if(i >= _shape->len) { + shape[ULAB_MAX_DIMS - i] = 0; } else { - shape[i] = mp_obj_get_int(_shape->items[i]); + shape[ULAB_MAX_DIMS - i] = mp_obj_get_int(_shape->items[i]); } } return ndarray_new_dense_ndarray(_shape->len, shape, dtype); diff --git a/code/ulab.c b/code/ulab.c index ff3b5831..fc770e9b 100644 --- a/code/ulab.c +++ b/code/ulab.c @@ -33,7 +33,7 @@ #include "user/user.h" #include "utils/utils.h" -#define ULAB_VERSION 6.3.1 +#define ULAB_VERSION 6.3.2 #define xstr(s) str(s) #define str(s) #s