pub enum QuantType {
Q8_0,
Q4_0,
Q4_1,
Q5_0,
Q5_1,
F16,
F32,
}Expand description
Quantization type enumeration.
Variants§
Q8_0
8-bit quantization with per-block scale. Format: scale (f16) + 32 x int8
Q4_0
4-bit quantization with per-block scale. Format: scale (f16) + 16 x uint8 (two 4-bit values each)
Q4_1
4-bit quantization with per-block scale and min. Format: scale (f16) + min (f16) + 16 x uint8
Q5_0
5-bit quantization with per-block scale.
Q5_1
5-bit quantization with per-block scale and min.
F16
Half-precision (16-bit float).
F32
Full precision (32-bit float).
Implementations§
Source§impl QuantType
impl QuantType
Sourcepub fn block_size(&self) -> usize
pub fn block_size(&self) -> usize
Returns the block size for this quantization type.
Sourcepub fn bytes_per_block(&self) -> usize
pub fn bytes_per_block(&self) -> usize
Returns the number of bytes per block.
Sourcepub fn bits_per_value(&self) -> usize
pub fn bits_per_value(&self) -> usize
Returns the bits per value.
Sourcepub fn compression_ratio(&self) -> f32
pub fn compression_ratio(&self) -> f32
Returns the compression ratio compared to F32.
Sourcepub fn is_block_quantized(&self) -> bool
pub fn is_block_quantized(&self) -> bool
Returns true if this type uses block quantization.
Trait Implementations§
impl Copy for QuantType
impl Eq for QuantType
impl StructuralPartialEq for QuantType
Auto Trait Implementations§
impl Freeze for QuantType
impl RefUnwindSafe for QuantType
impl Send for QuantType
impl Sync for QuantType
impl Unpin for QuantType
impl UnwindSafe for QuantType
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,
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>
Converts
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>
Converts
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