pub enum Precision {
F32,
F64,
Mixed16,
BFloat16,
}Expand description
Numerical precision for tensor computations.
Variants§
F32
32-bit floating point (faster, less memory)
F64
64-bit floating point (more accurate)
Mixed16
Mixed precision: f16 for storage, f32 for computation
BFloat16
Mixed precision: bf16 for storage, f32 for computation
Implementations§
Source§impl Precision
impl Precision
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Returns the size in bytes of this precision.
Sourcepub fn compute_precision(&self) -> ComputePrecision
pub fn compute_precision(&self) -> ComputePrecision
Returns the computation precision (the precision used for actual operations).
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Returns a human-readable description.
Sourcepub fn memory_savings(&self) -> f64
pub fn memory_savings(&self) -> f64
Memory savings compared to F64.
Trait Implementations§
impl Copy for Precision
impl Eq for Precision
impl StructuralPartialEq for Precision
Auto Trait Implementations§
impl Freeze for Precision
impl RefUnwindSafe for Precision
impl Send for Precision
impl Sync for Precision
impl Unpin for Precision
impl UnwindSafe for Precision
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