pub struct Quantization {
pub scale: f32,
pub zero_point: i32,
}Expand description
Describes the quantization parameters for a tensor
Fields§
§scale: f32§zero_point: i32Implementations§
Trait Implementations§
Source§impl Clone for Quantization
impl Clone for Quantization
Source§fn clone(&self) -> Quantization
fn clone(&self) -> Quantization
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Quantization
impl Debug for Quantization
Source§impl Default for Quantization
impl Default for Quantization
Source§impl<S, Z> From<(S, Z)> for Quantization
impl<S, Z> From<(S, Z)> for Quantization
Source§impl From<QuantTuple> for Quantization
impl From<QuantTuple> for Quantization
Source§fn from(quant_tuple: QuantTuple) -> Quantization
fn from(quant_tuple: QuantTuple) -> Quantization
Creates a new Quantization struct from a QuantTuple
§Examples
let quant_tuple = QuantTuple(0.1_f32, -128_i32);
let quant = Quantization::from(quant_tuple);
assert_eq!(quant.scale, 0.1);
assert_eq!(quant.zero_point, -128);Source§impl PartialEq for Quantization
impl PartialEq for Quantization
impl Copy for Quantization
impl StructuralPartialEq for Quantization
Auto Trait Implementations§
impl Freeze for Quantization
impl RefUnwindSafe for Quantization
impl Send for Quantization
impl Sync for Quantization
impl Unpin for Quantization
impl UnsafeUnpin for Quantization
impl UnwindSafe for Quantization
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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