Compare commits

..

1 Commits

Author SHA1 Message Date
dante
ca354f9261 refactor: allow for negative stride downsample 2025-03-13 16:33:36 -04:00
2 changed files with 2 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
import ezkl
project = 'ezkl'
release = '20.2.7'
release = '0.0.0'
version = release

View File

@@ -2346,11 +2346,7 @@ pub mod nonlinearities {
pub fn recip(a: &Tensor<IntegerRep>, input_scale: f64, out_scale: f64) -> Tensor<IntegerRep> {
a.par_enum_map(|_, a_i| {
let rescaled = (a_i as f64) / input_scale;
let denom = if rescaled == 0_f64 {
(1_f64) / (rescaled + f64::EPSILON)
} else {
(1_f64) / (rescaled)
};
let denom = (1_f64) / (rescaled + f64::EPSILON);
let d_inv_x = out_scale * denom;
Ok::<_, TensorError>(d_inv_x.round() as IntegerRep)
})