Struct SymmetricQuantization
pub struct SymmetricQuantization<E>{
pub scale: E,
/* private fields */
}Expand description
Symmetric quantization scheme.
Fields§
§scale: EThe scaling factor.
Implementations§
§impl<E> SymmetricQuantization<E>
impl<E> SymmetricQuantization<E>
pub fn init(scale: E, value: QuantValue) -> SymmetricQuantization<E>
pub fn init(scale: E, value: QuantValue) -> SymmetricQuantization<E>
Initialize a symmetric quantization scheme with the given parameters.
Trait Implementations§
§impl<E> Clone for SymmetricQuantization<E>
impl<E> Clone for SymmetricQuantization<E>
§fn clone(&self) -> SymmetricQuantization<E>
fn clone(&self) -> SymmetricQuantization<E>
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 more§impl<E> Debug for SymmetricQuantization<E>
impl<E> Debug for SymmetricQuantization<E>
§impl<'de, E> Deserialize<'de> for SymmetricQuantization<E>
impl<'de, E> Deserialize<'de> for SymmetricQuantization<E>
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SymmetricQuantization<E>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SymmetricQuantization<E>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<E> PartialEq for SymmetricQuantization<E>
impl<E> PartialEq for SymmetricQuantization<E>
§impl<E> Quantization<E> for SymmetricQuantization<E>
impl<E> Quantization<E> for SymmetricQuantization<E>
§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 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 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_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.
§impl<E> Serialize for SymmetricQuantization<E>
impl<E> Serialize for SymmetricQuantization<E>
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<E> Copy for SymmetricQuantization<E>
impl<E> Eq for SymmetricQuantization<E>
Auto Trait Implementations§
impl<E> Freeze for SymmetricQuantization<E>where
E: Freeze,
impl<E> RefUnwindSafe for SymmetricQuantization<E>where
E: RefUnwindSafe,
impl<E> Send for SymmetricQuantization<E>
impl<E> Sync for SymmetricQuantization<E>
impl<E> Unpin for SymmetricQuantization<E>where
E: Unpin,
impl<E> UnwindSafe for SymmetricQuantization<E>where
E: 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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
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