pub struct F32ToInt8 {
pub params: QuantizationParams,
pub calibration: Option<CalibrationData>,
pub tensor_params: Vec<(u32, u32, QuantizationParams)>,
pub calibration_result: Option<CalibrationResult>,
}Expand description
Converts array<f32> global variables to array<i8>.
When calibration data is provided, computes proper scale/zero_point
per tensor from observed min/max ranges. When a CalibrationResult
is attached, calibrated parameters are available for downstream
backends to emit quantization metadata (QDQ nodes, TFLite quant params).
Fields§
§params: QuantizationParamsPer-tensor quantization parameters.
calibration: Option<CalibrationData>Optional calibration data for computing scale/zero_point.
tensor_params: Vec<(u32, u32, QuantizationParams)>Per-tensor computed parameters (populated after run).
calibration_result: Option<CalibrationResult>Optional calibration result from the calibration pipeline.
Implementations§
Source§impl F32ToInt8
impl F32ToInt8
Sourcepub fn with_calibration(calibration: CalibrationData) -> Self
pub fn with_calibration(calibration: CalibrationData) -> Self
Create with calibration data.
Sourcepub fn with_calibration_result(result: CalibrationResult) -> Self
pub fn with_calibration_result(result: CalibrationResult) -> Self
Create with a calibration result from the calibration pipeline.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for F32ToInt8
impl RefUnwindSafe for F32ToInt8
impl Send for F32ToInt8
impl Sync for F32ToInt8
impl Unpin for F32ToInt8
impl UnsafeUnpin for F32ToInt8
impl UnwindSafe for F32ToInt8
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