pub enum QuantizedData {
Full(Vec<f32>),
Int8(QuantizedVector),
Int4(Int4Vector),
Binary(BinaryVector),
}Expand description
Unstable: unified quantized data container; variants may change with tier redesign.
Wraps the tier-specific vector types into a single enum for uniform storage and distance dispatch.
Variants§
Full(Vec<f32>)
Full-precision f32 vector.
Int8(QuantizedVector)
INT8 quantized vector.
Int4(Int4Vector)
INT4 packed quantized vector.
Binary(BinaryVector)
Binary sign-bit vector.
Implementations§
Source§impl QuantizedData
impl QuantizedData
Sourcepub fn tier(&self) -> QuantizationTier
pub fn tier(&self) -> QuantizationTier
Unstable: returns QuantizationTier which is itself Unstable.
Sourcepub fn dims(&self) -> usize
pub fn dims(&self) -> usize
Unstable: dimension accessor; may be removed if QuantizedData gains a dims field.
Sourcepub fn storage_bytes(&self) -> usize
pub fn storage_bytes(&self) -> usize
Unstable: storage byte count; may change with tier redesign.
Sourcepub fn from_f32(vector: &[f32], tier: QuantizationTier) -> Self
pub fn from_f32(vector: &[f32], tier: QuantizationTier) -> Self
Unstable: quantization factory; tier dispatch logic may change.
Sourcepub fn promote(&self, target: QuantizationTier) -> Self
pub fn promote(&self, target: QuantizationTier) -> Self
Unstable: re-quantizes through f32; lost information is not recovered.
Sourcepub fn demote(&self, target: QuantizationTier) -> Self
pub fn demote(&self, target: QuantizationTier) -> Self
Unstable: tier demotion; delegates to promote; may be removed.
Trait Implementations§
Source§impl Clone for QuantizedData
impl Clone for QuantizedData
Source§fn clone(&self) -> QuantizedData
fn clone(&self) -> QuantizedData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QuantizedData
impl RefUnwindSafe for QuantizedData
impl Send for QuantizedData
impl Sync for QuantizedData
impl Unpin for QuantizedData
impl UnsafeUnpin for QuantizedData
impl UnwindSafe for QuantizedData
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