pub struct MinMaxObserver {
pub min_val: f32,
pub max_val: f32,
pub bits: u32,
pub symmetric: bool,
}Expand description
Tracks the global minimum and maximum of observed values.
Symmetric quantization: scale = max(|min|, |max|) / q_max, zp = 0.
Asymmetric quantization: scale = (max − min) / (2^bits − 1).
Fields§
§min_val: f32Running minimum value.
max_val: f32Running maximum value.
bits: u32Quantization bit-width.
symmetric: boolSymmetric (zero-point = 0) vs asymmetric.
Implementations§
Trait Implementations§
Source§impl Clone for MinMaxObserver
impl Clone for MinMaxObserver
Source§fn clone(&self) -> MinMaxObserver
fn clone(&self) -> MinMaxObserver
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 MinMaxObserver
impl Debug for MinMaxObserver
Source§impl Observer for MinMaxObserver
impl Observer for MinMaxObserver
Source§fn compute_params(&self) -> QuantResult<(f32, i32)>
fn compute_params(&self) -> QuantResult<(f32, i32)>
Compute
(scale, zero_point) from accumulated statistics. Read moreSource§fn is_calibrated(&self) -> bool
fn is_calibrated(&self) -> bool
Whether any data has been observed.
Auto Trait Implementations§
impl Freeze for MinMaxObserver
impl RefUnwindSafe for MinMaxObserver
impl Send for MinMaxObserver
impl Sync for MinMaxObserver
impl Unpin for MinMaxObserver
impl UnsafeUnpin for MinMaxObserver
impl UnwindSafe for MinMaxObserver
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