pub struct BFloat16 { /* private fields */ }Expand description
BFloat16 — Google Brain’s 16-bit floating-point format.
Unlike IEEE fp16 (Half), bf16 shares f32’s exponent range, making it a drop-in replacement for f32 in training loops where dynamic range is more important than mantissa precision.
Implementations§
Source§impl BFloat16
impl BFloat16
pub const ZERO: Self
pub const ONE: Self
pub const NEG_ONE: Self
pub const INFINITY: Self
pub const NEG_INFINITY: Self
pub const NAN: Self
pub const MAX: Self
pub const MIN_POSITIVE: Self
pub const EPSILON: Self
Sourcepub fn is_infinite(self) -> bool
pub fn is_infinite(self) -> bool
Check if infinite.
Sourcepub fn is_sign_negative(self) -> bool
pub fn is_sign_negative(self) -> bool
Check if the sign bit is set.
Trait Implementations§
impl Copy for BFloat16
impl Eq for BFloat16
Source§impl PartialOrd for BFloat16
impl PartialOrd for BFloat16
impl StructuralPartialEq for BFloat16
Auto Trait Implementations§
impl Freeze for BFloat16
impl RefUnwindSafe for BFloat16
impl Send for BFloat16
impl Sync for BFloat16
impl Unpin for BFloat16
impl UnsafeUnpin for BFloat16
impl UnwindSafe for BFloat16
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<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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.