@@ -252,7 +252,7 @@ pub fn inplace_normalize(x: &mut [I32F32]) {
252
252
if x_sum == I32F32 :: from_num ( 0.0_f32 ) {
253
253
return ;
254
254
}
255
- x. into_iter ( )
255
+ x. iter_mut ( )
256
256
. for_each ( |value| * value = value. saturating_div ( x_sum) ) ;
257
257
}
258
258
@@ -262,7 +262,7 @@ pub fn inplace_normalize_using_sum(x: &mut [I32F32], x_sum: I32F32) {
262
262
if x_sum == I32F32 :: from_num ( 0.0_f32 ) {
263
263
return ;
264
264
}
265
- x. into_iter ( )
265
+ x. iter_mut ( )
266
266
. for_each ( |value| * value = value. saturating_div ( x_sum) ) ;
267
267
}
268
268
@@ -273,7 +273,7 @@ pub fn inplace_normalize_64(x: &mut [I64F64]) {
273
273
if x_sum == I64F64 :: from_num ( 0 ) {
274
274
return ;
275
275
}
276
- x. into_iter ( )
276
+ x. iter_mut ( )
277
277
. for_each ( |value| * value = value. saturating_div ( x_sum) ) ;
278
278
}
279
279
@@ -311,7 +311,7 @@ pub fn inplace_row_normalize(x: &mut [Vec<I32F32>]) {
311
311
for row in x {
312
312
let row_sum: I32F32 = row. iter ( ) . sum ( ) ;
313
313
if row_sum > I32F32 :: from_num ( 0.0_f32 ) {
314
- row. into_iter ( )
314
+ row. iter_mut ( )
315
315
. for_each ( |x_ij : & mut I32F32 | * x_ij = x_ij. saturating_div ( row_sum) ) ;
316
316
}
317
317
}
@@ -622,7 +622,7 @@ pub fn row_hadamard(matrix: &[Vec<I32F32>], vector: &[I32F32]) -> Vec<Vec<I32F32
622
622
. iter ( )
623
623
. zip ( vector)
624
624
. map ( |( row, vec_val) | {
625
- row. into_iter ( )
625
+ row. iter ( )
626
626
. map ( |m_val| vec_val. saturating_mul ( * m_val) )
627
627
. collect ( )
628
628
} )
@@ -640,7 +640,7 @@ pub fn row_hadamard_sparse(
640
640
. zip ( vector)
641
641
. map ( |( sparse_row, vec_val) | {
642
642
sparse_row
643
- . into_iter ( )
643
+ . iter ( )
644
644
. map ( |( j, value) | ( * j, value. saturating_mul ( * vec_val) ) )
645
645
. collect ( )
646
646
} )
0 commit comments