MCPcopy Index your code
hub / github.com/cosdata/cosdata / Quantization

Interface Quantization

src/quantization/mod.rs:8–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6use crate::storage::Storage;
7
8pub trait Quantization: std::fmt::Debug + Send + Sync {
9 fn quantize(
10 &self,
11 vector: &[f32],
12 storage_type: StorageType,
13 range: (f32, f32),
14 ) -> Result<Storage, QuantizationError>;
15
16 fn train(&mut self, vectors: &[&[f32]]) -> Result<(), QuantizationError>;
17}
18
19#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
20pub enum StorageType {

Callers

nothing calls this directly

Implementers 3

scalar.rssrc/quantization/scalar.rs
product.rssrc/quantization/product.rs
types.rssrc/models/types.rs

Calls

no outgoing calls

Tested by

no test coverage detected