pub struct Int8Codec { /* private fields */ }Expand description
Per-vector min/scale uniform int8: [min f32 | scale f32 | D bytes].
Same scheme as the legacy ScalarQuantized, but blob-oriented so the
plane can move it around like any other representation.
Implementations§
Trait Implementations§
Source§impl VectorCodec for Int8Codec
impl VectorCodec for Int8Codec
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Bytes per encoded vector.
Source§fn encode(&self, v: &[f32]) -> Result<Vec<u8>>
fn encode(&self, v: &[f32]) -> Result<Vec<u8>>
Encode a vector. The blob is self-sufficient for scoring.
Source§fn decode(&self, blob: &[u8]) -> Result<Vec<f32>>
fn decode(&self, blob: &[u8]) -> Result<Vec<f32>>
Reconstruct an approximation (exact only for
Fp32).Source§fn distance(&self, a: &[u8], b: &[u8]) -> Result<f32>
fn distance(&self, a: &[u8], b: &[u8]) -> Result<f32>
Symmetric blob×blob distance under this codec’s metric.
Source§fn make_query(&self, q: &[f32]) -> Result<Box<dyn EncodedQuery>>
fn make_query(&self, q: &[f32]) -> Result<Box<dyn EncodedQuery>>
Prepare a query for repeated asymmetric scoring against blobs.
Auto Trait Implementations§
impl Freeze for Int8Codec
impl RefUnwindSafe for Int8Codec
impl Send for Int8Codec
impl Sync for Int8Codec
impl Unpin for Int8Codec
impl UnsafeUnpin for Int8Codec
impl UnwindSafe for Int8Codec
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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