[−][src]Function tract_hir::internal::tract_itertools::fold
pub fn fold<I, B, F>(iterable: I, init: B, f: F) -> B where
F: FnMut(B, <I as IntoIterator>::Item) -> B,
I: IntoIterator,
Perform a fold operation over the iterable.
IntoIterator
enabled version of i.fold(init, f)
use itertools::fold; assert_eq!(fold(&[1., 2., 3.], 0., |a, &b| f32::max(a, b)), 3.);