MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / encode_inner

Method encode_inner

nodedb-codec/src/vector_quant/opq.rs:167–172  ·  view source on GitHub ↗
(&self, v: &[f32])

Source from the content-addressed store, hash-verified

165 }
166
167 fn encode_inner(&self, v: &[f32]) -> (Vec<u8>, UnifiedQuantizedVector) {
168 let rotated = self.apply_rotation(v);
169 let codes = pq_encode(&rotated, &self.codebooks, self.m, self.sub_dim);
170 let uqv = make_uqv(&codes, self.dim as u16);
171 (codes, uqv)
172 }
173
174 fn dequantize(&self, codes: &[u8]) -> Vec<f32> {
175 dequantize_codes(codes, &self.codebooks)

Callers 1

encodeMethod · 0.45

Calls 3

pq_encodeFunction · 0.85
make_uqvFunction · 0.85
apply_rotationMethod · 0.45

Tested by

no test coverage detected