Skip to content

Commit

Permalink
fix array shape in create_frombuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
v923z committed Jul 20, 2024
1 parent 2b274f1 commit c231a0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/numpy/create.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit c231a0f

Please sign in to comment.