@@ -181,8 +181,8 @@ mp_obj_t ndarray_binary_add(ndarray_obj_t *lhs, ndarray_obj_t *rhs,
181
181
182
182
if (lhs -> dtype == NDARRAY_UINT8 ) {
183
183
if (rhs -> dtype == NDARRAY_UINT8 ) {
184
- results = ndarray_new_dense_ndarray (ndim , shape , NDARRAY_UINT16 );
185
- BINARY_LOOP (results , uint16_t , uint8_t , uint8_t , larray , lstrides , rarray , rstrides , + );
184
+ results = ndarray_new_dense_ndarray (ndim , shape , NDARRAY_UINT8 );
185
+ BINARY_LOOP (results , uint8_t , uint8_t , uint8_t , larray , lstrides , rarray , rstrides , + );
186
186
} else if (rhs -> dtype == NDARRAY_INT8 ) {
187
187
results = ndarray_new_dense_ndarray (ndim , shape , NDARRAY_INT16 );
188
188
BINARY_LOOP (results , int16_t , uint8_t , int8_t , larray , lstrides , rarray , rstrides , + );
@@ -264,8 +264,8 @@ mp_obj_t ndarray_binary_multiply(ndarray_obj_t *lhs, ndarray_obj_t *rhs,
264
264
265
265
if (lhs -> dtype == NDARRAY_UINT8 ) {
266
266
if (rhs -> dtype == NDARRAY_UINT8 ) {
267
- results = ndarray_new_dense_ndarray (ndim , shape , NDARRAY_UINT16 );
268
- BINARY_LOOP (results , uint16_t , uint8_t , uint8_t , larray , lstrides , rarray , rstrides , * );
267
+ results = ndarray_new_dense_ndarray (ndim , shape , NDARRAY_UINT8 );
268
+ BINARY_LOOP (results , uint8_t , uint8_t , uint8_t , larray , lstrides , rarray , rstrides , * );
269
269
} else if (rhs -> dtype == NDARRAY_INT8 ) {
270
270
results = ndarray_new_dense_ndarray (ndim , shape , NDARRAY_INT16 );
271
271
BINARY_LOOP (results , int16_t , uint8_t , int8_t , larray , lstrides , rarray , rstrides , * );
@@ -1059,7 +1059,7 @@ mp_obj_t ndarray_inplace_ams(ndarray_obj_t *lhs, ndarray_obj_t *rhs, int32_t *rs
1059
1059
UNWRAP_INPLACE_OPERATOR (lhs , larray , rarray , rstrides , + = );
1060
1060
}
1061
1061
#endif
1062
- #if NDARRAY_HAS_INPLACE_ADD
1062
+ #if NDARRAY_HAS_INPLACE_MULTIPLY
1063
1063
if (optype == MP_BINARY_OP_INPLACE_MULTIPLY ) {
1064
1064
UNWRAP_INPLACE_OPERATOR (lhs , larray , rarray , rstrides , * = );
1065
1065
}
0 commit comments