pub struct F16Quantizer { /* private fields */ }Expand description
Half-precision (f16) quantizer.
Each f32 dimension is stored as f16 (2 bytes), giving 2x compression. Uses SIMD-accelerated conversion and fused distance when available.
Implementations§
Source§impl F16Quantizer
impl F16Quantizer
Sourcepub fn load(path: &str) -> Result<Self, DiskAnnError>
pub fn load(path: &str) -> Result<Self, DiskAnnError>
Load from file.
Trait Implementations§
Source§impl Clone for F16Quantizer
impl Clone for F16Quantizer
Source§fn clone(&self) -> F16Quantizer
fn clone(&self) -> F16Quantizer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for F16Quantizer
impl Debug for F16Quantizer
Source§impl<'de> Deserialize<'de> for F16Quantizer
impl<'de> Deserialize<'de> for F16Quantizer
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for F16Quantizer
impl Serialize for F16Quantizer
Source§impl VectorQuantizer for F16Quantizer
impl VectorQuantizer for F16Quantizer
Source§fn decode(&self, codes: &[u8]) -> Vec<f32>
fn decode(&self, codes: &[u8]) -> Vec<f32>
Decode compressed bytes back to an approximate float vector.
Source§fn asymmetric_distance(&self, query: &[f32], codes: &[u8]) -> f32
fn asymmetric_distance(&self, query: &[f32], codes: &[u8]) -> f32
Compute asymmetric distance: exact query vs quantized database vector.
Source§fn compression_ratio(&self, dim: usize) -> f32
fn compression_ratio(&self, dim: usize) -> f32
Compression ratio for a given dimension (original bytes / compressed bytes).
Auto Trait Implementations§
impl Freeze for F16Quantizer
impl RefUnwindSafe for F16Quantizer
impl Send for F16Quantizer
impl Sync for F16Quantizer
impl Unpin for F16Quantizer
impl UnwindSafe for F16Quantizer
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