Skip to content

Commit

Permalink
clips
Browse files Browse the repository at this point in the history
  • Loading branch information
kali committed Oct 7, 2024
1 parent c7ad7e3 commit f0ca526
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/ops/quant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ pub mod scale {
fn test_scale(a: i8, b: i8, scale: f32) {
let expected = (((a as i32) * (b as i32)) as f32) / scale;
let expected = round_ties_to_even(expected.abs()) * expected.signum();
let expected = (expected as i32).max(-128).min(127);
let expected = (expected as i32).clamp(-128, 127);
let expected = tensor2(&[[expected as i8]]);

let input = tvec!(tensor2(&[[b]]).into_tvalue());
Expand Down
2 changes: 1 addition & 1 deletion linalg/benches/softmax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tract_linalg::generic::reduce::softmax_l2::SSoftMaxL2;

#[inline(never)]
fn loop1_f32_naive(slice: &mut [f32]) -> f32 {
let mut max = std::f32::MIN;
let mut max = f32::MIN;
for x in &*slice {
if *x > max {
max = *x;
Expand Down

0 comments on commit f0ca526

Please sign in to comment.