pub enum Scheme {
Int8 {
symmetric: bool,
},
Int4 {
symmetric: bool,
},
Fp8 {
variant: Fp8Variant,
},
}Expand description
Which quantization scheme to apply to a tensor.
Variants§
Int8
8-bit affine integer quantization.
Int4
4-bit affine integer quantization, nibble-packed into U8 (see pack4).
Fp8
8-bit floating point.
Fields
§
variant: Fp8VariantWhich OCP FP8 encoding.
Implementations§
Source§impl Scheme
impl Scheme
Sourcepub fn type_name(self) -> &'static str
pub fn type_name(self) -> &'static str
The compressed-tensors weights.type field for this scheme.
Sourcepub fn is_symmetric(self) -> bool
pub fn is_symmetric(self) -> bool
Whether this scheme is symmetric (zero_point = 0 / no zero-point tensor written).
Sourcepub fn short_name(self) -> String
pub fn short_name(self) -> String
A short, stable name used in CLI output and file names (e.g. int8, int4, fp8_e4m3).
Trait Implementations§
impl Copy for Scheme
impl Eq for Scheme
impl StructuralPartialEq for Scheme
Auto Trait Implementations§
impl Freeze for Scheme
impl RefUnwindSafe for Scheme
impl Send for Scheme
impl Sync for Scheme
impl Unpin for Scheme
impl UnsafeUnpin for Scheme
impl UnwindSafe for Scheme
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.