pub struct SymmetricQuantization<E: Float + Send + Sync, Q: PrimInt + Signed + Send + Sync> {
pub scale: E,
/* private fields */
}
Expand description
Symmetric quantization scheme.
Fields§
§scale: E
The scaling factor.
Implementations§
Trait Implementations§
Source§impl<E: Clone + Float + Send + Sync, Q: Clone + PrimInt + Signed + Send + Sync> Clone for SymmetricQuantization<E, Q>
impl<E: Clone + Float + Send + Sync, Q: Clone + PrimInt + Signed + Send + Sync> Clone for SymmetricQuantization<E, Q>
Source§fn clone(&self) -> SymmetricQuantization<E, Q>
fn clone(&self) -> SymmetricQuantization<E, Q>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<E: Debug + Float + Send + Sync, Q: Debug + PrimInt + Signed + Send + Sync> Debug for SymmetricQuantization<E, Q>
impl<E: Debug + Float + Send + Sync, Q: Debug + PrimInt + Signed + Send + Sync> Debug for SymmetricQuantization<E, Q>
Source§impl<'de, E, Q: PrimInt + Signed + Send + Sync> Deserialize<'de> for SymmetricQuantization<E, Q>
impl<'de, E, Q: PrimInt + Signed + Send + Sync> Deserialize<'de> for SymmetricQuantization<E, Q>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<E: Float + Send + Sync, Q: PrimInt + Signed + Send + Sync> PartialEq for SymmetricQuantization<E, Q>
impl<E: Float + Send + Sync, Q: PrimInt + Signed + Send + Sync> PartialEq for SymmetricQuantization<E, Q>
Source§impl<E: Float + Send + Sync, Q: PrimInt + Signed + Send + Sync> Quantization<E, Q> for SymmetricQuantization<E, Q>
impl<E: Float + Send + Sync, Q: PrimInt + Signed + Send + Sync> Quantization<E, Q> for SymmetricQuantization<E, Q>
Source§fn new(alpha: E, beta: E) -> Self
fn new(alpha: E, beta: E) -> Self
Create a new quantization scheme for an input range
[alpha, beta]
.Source§fn dequantize(&self, values: &[Q]) -> Vec<E>
fn dequantize(&self, values: &[Q]) -> Vec<E>
Convert the values back to a higher precision data type.
Source§fn quantize_one(&self, value: E) -> Q
fn quantize_one(&self, value: E) -> Q
Convert a single value to a lower precision data type.
Source§fn dequantize_one(&self, value: Q) -> E
fn dequantize_one(&self, value: Q) -> E
Convert a single value back to a higher precision data type.
impl<E: Copy + Float + Send + Sync, Q: Copy + PrimInt + Signed + Send + Sync> Copy for SymmetricQuantization<E, Q>
impl<E: Float + Send + Sync, Q: PrimInt + Signed + Send + Sync> Eq for SymmetricQuantization<E, Q>
Auto Trait Implementations§
impl<E, Q> Freeze for SymmetricQuantization<E, Q>where
E: Freeze,
impl<E, Q> RefUnwindSafe for SymmetricQuantization<E, Q>where
E: RefUnwindSafe,
Q: RefUnwindSafe,
impl<E, Q> Send for SymmetricQuantization<E, Q>
impl<E, Q> Sync for SymmetricQuantization<E, Q>
impl<E, Q> Unpin for SymmetricQuantization<E, Q>
impl<E, Q> UnwindSafe for SymmetricQuantization<E, Q>where
E: UnwindSafe,
Q: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more