pub struct Quantize<'s, 'd, To> { /* private fields */ }
Expand description
Quantize a slice of f32
elements to 8-bit integers using the formula:
y = saturate(round(x * inv_scale) + zero_point)
Where round
rounds to the nearest i32
value with ties to even and
saturate
converts i32
to the small integer type To
with saturation.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'s, 'd, To> Freeze for Quantize<'s, 'd, To>where
To: Freeze,
impl<'s, 'd, To> RefUnwindSafe for Quantize<'s, 'd, To>where
To: RefUnwindSafe,
impl<'s, 'd, To> Send for Quantize<'s, 'd, To>where
To: Send,
impl<'s, 'd, To> Sync for Quantize<'s, 'd, To>where
To: Sync,
impl<'s, 'd, To> Unpin for Quantize<'s, 'd, To>where
To: Unpin,
impl<'s, 'd, To> !UnwindSafe for Quantize<'s, 'd, To>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more