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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more