MCPcopy Create free account
hub / github.com/cosdata/cosdata / quantize

Method quantize

src/models/types.rs:508–518  ·  view source on GitHub ↗
(
        &self,
        vector: &[f32],
        storage_type: StorageType,
        range: (f32, f32),
    )

Source from the content-addressed store, hash-verified

506
507impl Quantization for QuantizationMetric {
508 fn quantize(
509 &self,
510 vector: &[f32],
511 storage_type: StorageType,
512 range: (f32, f32),
513 ) -> Result<Storage, QuantizationError> {
514 match self {
515 Self::Scalar => ScalarQuantization.quantize(vector, storage_type, range),
516 Self::Product(product) => product.quantize(vector, storage_type, range),
517 }
518 }
519
520 fn train(&mut self, vectors: &[&[f32]]) -> Result<(), QuantizationError> {
521 match self {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected