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: u8
The number of bits used for quantization
scale: f32
The scale factor used to convert between quantized and float values For per-channel quantization, this is the default scale for debugging
zero_point: i32
The zero point used for asymmetric quantization (for affine quantization) For per-channel quantization, this is the default zero point for debugging
min_val: f32
The minimum value of the original data For per-channel quantization, this is across all channels
max_val: f32
The maximum value of the original data For per-channel quantization, this is across all channels
method: QuantizationMethod
The quantization method used
data_type: QuantizedDataType
The 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 · 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 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
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>
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