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: tier promotion; re-quantizes via f32; may be rethought.
Dequantizes to f32 then re-quantizes at the target tier. Note: this does NOT recover lost information – it merely changes the storage format. INT4 -> INT8 promotion fills in new bits based on the dequantized approximation.
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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more