@@ -1426,66 +1426,6 @@ MP_DEFINE_CONST_FUN_OBJ_KW(numerical_std_obj, 1, numerical_std);
1426
1426
1427
1427
mp_obj_t numerical_sum (size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
1428
1428
return numerical_function (n_args , pos_args , kw_args , NUMERICAL_SUM );
1429
- // static const mp_arg_t allowed_args[] = {
1430
- // { MP_QSTR_, MP_ARG_REQUIRED | MP_ARG_OBJ, { .u_rom_obj = MP_ROM_NONE} } ,
1431
- // { MP_QSTR_axis, MP_ARG_OBJ, { .u_rom_obj = MP_ROM_NONE } },
1432
- // { MP_QSTR_keepdims, MP_ARG_OBJ, { .u_rom_obj = MP_ROM_FALSE } },
1433
- // };
1434
-
1435
- // mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
1436
- // mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
1437
-
1438
- // mp_obj_t oin = args[0].u_obj;
1439
- // mp_obj_t axis = args[1].u_obj;
1440
- // mp_obj_t keepdims = args[2].u_obj;
1441
-
1442
- // if((axis != mp_const_none) && (!mp_obj_is_int(axis))) {
1443
- // mp_raise_TypeError(MP_ERROR_TEXT("axis must be None, or an integer"));
1444
- // }
1445
-
1446
- // ndarray_obj_t *ndarray = MP_OBJ_TO_PTR(oin);
1447
- // if(!mp_obj_is_int(axis) & (axis != mp_const_none)) {
1448
- // mp_raise_TypeError(MP_ERROR_TEXT("axis must be None, or an integer"));
1449
- // }
1450
-
1451
- // shape_strides _shape_strides;
1452
-
1453
- // _shape_strides.increment = 0;
1454
- // // this is the contracted dimension (won't be overwritten for axis == None)
1455
- // _shape_strides.ndim = 0;
1456
-
1457
- // size_t *shape = m_new(size_t, ULAB_MAX_DIMS);
1458
- // _shape_strides.shape = shape;
1459
- // int32_t *strides = m_new(int32_t, ULAB_MAX_DIMS);
1460
- // _shape_strides.strides = strides;
1461
-
1462
- // memcpy(_shape_strides.shape, ndarray->shape, sizeof(size_t) * ULAB_MAX_DIMS);
1463
- // memcpy(_shape_strides.strides, ndarray->strides, sizeof(int32_t) * ULAB_MAX_DIMS);
1464
-
1465
- // uint8_t index = ULAB_MAX_DIMS - 1; // value of index for axis == mp_const_none (won't be overwritten)
1466
-
1467
- // if(axis != mp_const_none) { // i.e., axis is an integer
1468
- // int8_t ax = tools_get_axis(axis, ndarray->ndim);
1469
- // index = ULAB_MAX_DIMS - ndarray->ndim + ax;
1470
- // _shape_strides.ndim = ndarray->ndim - 1;
1471
- // }
1472
-
1473
- // // move the value stored at index to the leftmost position, and align everything else to the right
1474
- // _shape_strides.shape[0] = ndarray->shape[index];
1475
- // _shape_strides.strides[0] = ndarray->strides[index];
1476
- // for(uint8_t i = 0; i < index; i++) {
1477
- // // entries to the right of index must be shifted by one position to the left
1478
- // _shape_strides.shape[i + 1] = ndarray->shape[i];
1479
- // _shape_strides.strides[i + 1] = ndarray->strides[i];
1480
- // }
1481
-
1482
- // if(_shape_strides.ndim != 0) {
1483
- // _shape_strides.increment = 1;
1484
- // }
1485
-
1486
-
1487
- // return mp_const_none;
1488
-
1489
1429
}
1490
1430
1491
1431
MP_DEFINE_CONST_FUN_OBJ_KW (numerical_sum_obj , 1 , numerical_sum );
0 commit comments