pub enum Fp8Format {
E4M3,
E5M2,
}Expand description
8-bit floating-point formats modelled by fake_quant_fp8.
Variants§
E4M3
4 exponent bits, 3 mantissa bits, bias 7, max-normal 448 (no infinities).
E5M2
5 exponent bits, 2 mantissa bits, bias 15, max-normal 57344 (IEEE-like).
Implementations§
Source§impl Fp8Format
impl Fp8Format
Sourcepub fn mantissa_bits(self) -> i32
pub fn mantissa_bits(self) -> i32
Number of explicit mantissa bits.
Sourcepub fn exponent_bias(self) -> i32
pub fn exponent_bias(self) -> i32
Exponent bias.
Sourcepub fn max_normal(self) -> f64
pub fn max_normal(self) -> f64
Largest finite representable magnitude (the documented max-normal).
Sourcepub fn min_normal(self) -> f64
pub fn min_normal(self) -> f64
Smallest normal magnitude, 2^(1 - bias).
Sourcepub fn min_subnormal(self) -> f64
pub fn min_subnormal(self) -> f64
Smallest (subnormal) positive magnitude, 2^(1 - bias - mantissa_bits).
Trait Implementations§
impl Copy for Fp8Format
impl Eq for Fp8Format
impl StructuralPartialEq for Fp8Format
Auto Trait Implementations§
impl Freeze for Fp8Format
impl RefUnwindSafe for Fp8Format
impl Send for Fp8Format
impl Sync for Fp8Format
impl Unpin for Fp8Format
impl UnsafeUnpin for Fp8Format
impl UnwindSafe for Fp8Format
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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