pub struct QuantScheme {
    pub value: QuantValue,
    pub param: QuantParam,
    pub store: QuantStore,
    pub level: QuantLevel,
    pub mode: QuantMode,
}Expand description
Describes a quantization scheme/configuration.
Fields§
§value: QuantValueThe logical data type of quantized input values (e.g., QInt8).
This defines how values are interpreted during computation, independent of how they’re stored.
param: QuantParamPrecision used for quantization parameters (e.g., scale and biases).
store: QuantStoreData type used for storing quantized values.
level: QuantLevelGranularity level of quantization (e.g., per-tensor).
mode: QuantModeQuantization mode (e.g., symmetric).
Implementations§
Source§impl QuantScheme
 
impl QuantScheme
Sourcepub fn with_level(self, level: QuantLevel) -> Self
 
pub fn with_level(self, level: QuantLevel) -> Self
Set the quantization level.
Sourcepub fn with_value(self, value: QuantValue) -> Self
 
pub fn with_value(self, value: QuantValue) -> Self
Set the data type used for quantized values.
Sourcepub fn with_store(self, store: QuantStore) -> Self
 
pub fn with_store(self, store: QuantStore) -> Self
Set the data type used to store quantized values.
Sourcepub fn with_param(self, param: QuantParam) -> Self
 
pub fn with_param(self, param: QuantParam) -> Self
Set the precision used for quantization parameters
Sourcepub fn size_bits_stored(&self) -> usize
 
pub fn size_bits_stored(&self) -> usize
Returns the size of the quantization storage type in bits.
Sourcepub fn size_bits_value(&self) -> usize
 
pub fn size_bits_value(&self) -> usize
Returns the size of the quantization storage type in bits.
Sourcepub fn num_quants(&self) -> usize
 
pub fn num_quants(&self) -> usize
Returns the number of quantized values stored in a single element.
Sourcepub fn native_packing(&self) -> usize
 
pub fn native_packing(&self) -> usize
Returns the native packing factor for the values. When native packing > 1, the packed
representation stores num_quants elements grouped into packs of native_packing size.
Trait Implementations§
Source§impl Clone for QuantScheme
 
impl Clone for QuantScheme
Source§fn clone(&self) -> QuantScheme
 
fn clone(&self) -> QuantScheme
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuantScheme
 
impl Debug for QuantScheme
Source§impl Default for QuantScheme
 
impl Default for QuantScheme
Source§impl<'de> Deserialize<'de> for QuantScheme
 
impl<'de> Deserialize<'de> for QuantScheme
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
 
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
Source§impl Hash for QuantScheme
 
impl Hash for QuantScheme
Source§impl Ord for QuantScheme
 
impl Ord for QuantScheme
Source§fn cmp(&self, other: &QuantScheme) -> Ordering
 
fn cmp(&self, other: &QuantScheme) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
Source§impl PartialEq for QuantScheme
 
impl PartialEq for QuantScheme
Source§impl PartialOrd for QuantScheme
 
impl PartialOrd for QuantScheme
Source§impl Serialize for QuantScheme
 
impl Serialize for QuantScheme
impl Copy for QuantScheme
impl Eq for QuantScheme
impl StructuralPartialEq for QuantScheme
Auto Trait Implementations§
impl Freeze for QuantScheme
impl RefUnwindSafe for QuantScheme
impl Send for QuantScheme
impl Sync for QuantScheme
impl Unpin for QuantScheme
impl UnwindSafe for QuantScheme
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<Q, K> Comparable<K> for Q
 
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.