pub trait Observer {
// Required methods
fn observe(&mut self, data: &[f32]);
fn compute_params(&self) -> QuantResult<(f32, i32)>;
fn reset(&mut self);
fn is_calibrated(&self) -> bool;
}Expand description
Common interface for all quantization observers.
Required Methods§
Sourcefn compute_params(&self) -> QuantResult<(f32, i32)>
fn compute_params(&self) -> QuantResult<(f32, i32)>
Compute (scale, zero_point) from accumulated statistics.
§Errors
Returns QuantError::CalibrationRequired if no data has been observed.
Sourcefn is_calibrated(&self) -> bool
fn is_calibrated(&self) -> bool
Whether any data has been observed.