Skip to content

Commit 043dec5

Browse files
committed
Merge branch 'main-dev' of https://github.com/ashvardanian/SimSIMD into main-dev
2 parents b9d7834 + 658901d commit 043dec5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

rust/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,4 +1682,14 @@ mod tests {
16821682
assert!(!a.is_nan());
16831683
assert!(!a.is_infinite());
16841684
}
1685+
1686+
#[test]
1687+
fn bf16_dot() {
1688+
let brain_a: Vec<bf16> = vec![1.0, 2.0, 3.0, 1.0, 2.0].iter().map(|&x| bf16::from_f32(x)).collect();
1689+
let brain_b: Vec<bf16> = vec![4.0, 5.0, 6.0, 4.0, 5.0].iter().map(|&x| bf16::from_f32(x)).collect();
1690+
if let Some(result) = <bf16 as SpatialSimilarity>::dot(&brain_a, &brain_b) {
1691+
println!("The result of bf16_dot is {}", result);
1692+
assert_eq!(46.0, result);
1693+
}
1694+
}
16851695
}

0 commit comments

Comments
 (0)