Skip to content

Commit fe3e19c

Browse files
committed
added frombuffer stub
1 parent 3848e4d commit fe3e19c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

code/ulab_create.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,19 @@ MP_DEFINE_CONST_FUN_OBJ_KW(create_zeros_obj, 0, create_zeros);
632632
#endif
633633

634634
#if ULAB_CREATE_HAS_FROMBUFFER
635+
//| def frombuffer(buffer, dtype=ulab.float, count=-1, offset=0) ->ulab.array:
636+
//| """
637+
//| .. param: buffer
638+
//| bufferlike object
639+
//| .. param: dtype
640+
//| Type of the output array
641+
//| .. param: count
642+
//| number of items to read. -1 means all data in the buffer
643+
//| .. param: offset
644+
//| start reading the buffer from this offset (in bytes); default: 0
645+
//| Interpret a buffer as a 1-dimensional array."""
646+
//| ...
647+
//|
635648
mp_obj_t create_frombuffer(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
636649
static const mp_arg_t allowed_args[] = {
637650
{ MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ, { .u_rom_obj = mp_const_none } },

0 commit comments

Comments
 (0)