Function forust_ml::utils::fast_sum

source ·
pub fn fast_sum<T: FloatData<T>>(values: &[T]) -> T
Expand description

Fast summation, ends up being roughly 8 to 10 times faster than values.iter().copied().sum(). Shamelessly stolen from https://stackoverflow.com/a/67191480