Enum QuantValue
pub enum QuantValue {
Q8F,
E5M2,
E4M3,
Q4F,
E2M1,
Q2F,
Q8S,
Q4S,
Q2S,
}Expand description
Data type used to represent quantized values.
Variants§
Q8F
8-bit quantization with full range.
E5M2
8-bit floating point, e5m2 format.
E4M3
8-bit floating point, e4m3 format.
Q4F
4-bit quantization with full range.
E2M1
4-bit floating point, e2m1 format.
Q2F
2-bit quantization with full range.
Q8S
8-bit quantization with symmetric range.
Q4S
4-bit quantization with symmetric range.
Q2S
2-bit quantization with symmetric range.
Implementations§
§impl QuantValue
impl QuantValue
pub fn native_packing(&self) -> usize
pub fn native_packing(&self) -> usize
Packing factor for the native representation used for intermediate values. If > 1, values
should always be processed in native_packing sized chunks.
pub fn is_symmetric(&self) -> bool
pub fn is_symmetric(&self) -> bool
If the range of values is symmetric around zero.
Trait Implementations§
§impl Clone for QuantValue
impl Clone for QuantValue
§fn clone(&self) -> QuantValue
fn clone(&self) -> QuantValue
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 Debug for QuantValue
impl Debug for QuantValue
§impl<'de> Deserialize<'de> for QuantValue
impl<'de> Deserialize<'de> for QuantValue
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<QuantValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<QuantValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Hash for QuantValue
impl Hash for QuantValue
§impl Ord for QuantValue
impl Ord for QuantValue
§impl PartialEq for QuantValue
impl PartialEq for QuantValue
§impl PartialOrd for QuantValue
impl PartialOrd for QuantValue
§impl Serialize for QuantValue
impl Serialize for QuantValue
§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 Copy for QuantValue
impl Eq for QuantValue
impl StructuralPartialEq for QuantValue
Auto Trait Implementations§
impl Freeze for QuantValue
impl RefUnwindSafe for QuantValue
impl Send for QuantValue
impl Sync for QuantValue
impl Unpin for QuantValue
impl UnwindSafe for QuantValue
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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