| 6 | use crate::storage::Storage; |
| 7 | |
| 8 | pub 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)] |
| 20 | pub enum StorageType { |
nothing calls this directly
no outgoing calls
no test coverage detected