fix array shape in create_frombuffer

This commit is contained in:
Zoltán Vörös 2024-07-21 00:20:34 +02:00
parent 2b274f1233
commit c231a0fe91

View file

@ -839,7 +839,7 @@ mp_obj_t create_frombuffer(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw
}
}
size_t *shape = ndarray_shape_vector(0, 0, 0, 1);
size_t *shape = ndarray_shape_vector(0, 0, 0, len);
uint8_t *buffer = bufinfo.buf;
return ndarray_new_ndarray(1, shape, NULL, dtype, buffer + offset);
}