Skip to content

Commit

Permalink
Merge pull request #88 from wx-csy/patch-1
Browse files Browse the repository at this point in the history
Fix Sum<&'a bf16> for bf16
  • Loading branch information
starkat99 committed Jun 24, 2023
2 parents 1d7f862 + 5dc7591 commit aa6462e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bfloat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ impl Sum for bf16 {
impl<'a> Sum<&'a bf16> for bf16 {
#[inline]
fn sum<I: Iterator<Item = &'a bf16>>(iter: I) -> Self {
bf16::from_f32(iter.map(|f| f.to_f32()).product())
bf16::from_f32(iter.map(|f| f.to_f32()).sum())
}
}

Expand Down

0 comments on commit aa6462e

Please sign in to comment.