pub struct QuantizationParams {
pub bits: u8,
pub scale: f32,
pub zero_point: i32,
pub min_val: f32,
pub max_val: f32,
pub method: QuantizationMethod,
pub data_type: QuantizedDataType,
pub channel_scales: Option<Vec<f32>>,
pub channel_zero_points: Option<Vec<i32>>,
}Expand description
Parameters for the quantization process
Fields§
§bits: u8The number of bits used for quantization
scale: f32The scale factor used to convert between quantized and float values For per-channel quantization, this is the default scale for debugging
zero_point: i32The zero point used for asymmetric quantization (for affine quantization) For per-channel quantization, this is the default zero point for debugging
min_val: f32The minimum value of the original data For per-channel quantization, this is across all channels
max_val: f32The maximum value of the original data For per-channel quantization, this is across all channels
method: QuantizationMethodThe quantization method used
data_type: QuantizedDataTypeThe data type used for storage
channel_scales: Option<Vec<f32>>Per-channel scale factors (only used for per-channel quantization)
channel_zero_points: Option<Vec<i32>>Per-channel zero points (only used for per-channel affine quantization)
Trait Implementations§
Source§impl Clone for QuantizationParams
impl Clone for QuantizationParams
Source§fn clone(&self) -> QuantizationParams
fn clone(&self) -> QuantizationParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for QuantizationParams
impl RefUnwindSafe for QuantizationParams
impl Send for QuantizationParams
impl Sync for QuantizationParams
impl Unpin for QuantizationParams
impl UnsafeUnpin for QuantizationParams
impl UnwindSafe for QuantizationParams
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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