Expand cold-packed bits to hot if needed.
(packed: &[u8], quant_mode: u16, dim: usize)
| 53 | |
| 54 | /// Expand cold-packed bits to hot if needed. |
| 55 | fn ensure_hot(packed: &[u8], quant_mode: u16, dim: usize) -> std::borrow::Cow<'_, [u8]> { |
| 56 | if quant_mode == QuantMode::TernaryPacked as u16 { |
| 57 | std::borrow::Cow::Owned(cold_to_hot(packed, dim)) |
| 58 | } else { |
| 59 | std::borrow::Cow::Borrowed(packed) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | impl VectorCodec for TernaryCodec { |
| 64 | type Quantized = TernaryQuantized; |
no test coverage detected