Update ndarray.c
Fix bug in ndarray_tobytes()
@@ -1554,7 +1554,7 @@ mp_obj_t ndarray_tobytes(mp_obj_t self_in) {
if(!ndarray_is_dense(self)) {
mp_raise_ValueError(translate("tobytes can be invoked for dense arrays only"));
}
- return mp_obj_new_bytearray_by_ref(self->len, self->array);
+ return mp_obj_new_bytearray_by_ref(self->itemsize * self->len, self->array);
}
MP_DEFINE_CONST_FUN_OBJ_1(ndarray_tobytes_obj, ndarray_tobytes);
