Trait Quantization
pub trait Quantization<E>{
// Required methods
fn range(&self) -> (E, E);
fn quantize<Q>(&self, values: &[E]) -> Vec<Q>
where Q: PrimInt;
fn quantize_one<Q>(&self, value: E) -> Q
where Q: PrimInt;
fn dequantize<Q>(&self, values: &[Q]) -> Vec<E>
where Q: PrimInt;
fn dequantize_one<Q>(&self, value: Q) -> E
where Q: PrimInt;
}Expand description
Quantization scheme to convert elements of a higher precision data type E to a lower precision
data type Q and vice-versa.
Required Methods§
fn quantize<Q>(&self, values: &[E]) -> Vec<Q>where
Q: PrimInt,
fn quantize<Q>(&self, values: &[E]) -> Vec<Q>where
Q: PrimInt,
Convert the values to a lower precision data type.
fn quantize_one<Q>(&self, value: E) -> Qwhere
Q: PrimInt,
fn quantize_one<Q>(&self, value: E) -> Qwhere
Q: PrimInt,
Convert a single value to a lower precision data type.
fn dequantize<Q>(&self, values: &[Q]) -> Vec<E>where
Q: PrimInt,
fn dequantize<Q>(&self, values: &[Q]) -> Vec<E>where
Q: PrimInt,
Convert the values back to a higher precision data type.
fn dequantize_one<Q>(&self, value: Q) -> Ewhere
Q: PrimInt,
fn dequantize_one<Q>(&self, value: Q) -> Ewhere
Q: PrimInt,
Convert a single value back to a higher precision data type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.