MCPcopy Create free account
hub / github.com/alibaba/zvec / encode

Method encode

src/turbo/quantizer/entropy_integer_quantizer/integer_quantizer.cc:294–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292
293// Encode to INT16
294void EntropyInt16Quantizer::encode(const float *in, size_t dim,
295 int16_t *out) const {
296 for (size_t i = 0; i < dim; ++i) {
297 out[i] = static_cast<int16_t>(
298 std::round(QuantizeValue<MIN_VALUE, MAX_VALUE>(in[i], scale_, bias_)));
299 }
300}
301
302// Decode from INT16
303void EntropyInt16Quantizer::decode(const int16_t *in, size_t dim,

Callers

nothing calls this directly

Tested by

no test coverage detected