pub struct PrecisionConfig {
pub default_precision: Precision,
pub auto_mixed_precision: bool,
pub loss_scale: Option<f64>,
pub dynamic_loss_scaling: bool,
}Expand description
Precision configuration for an executor.
Fields§
§default_precision: PrecisionDefault precision for tensors
auto_mixed_precision: boolEnable automatic mixed precision
loss_scale: Option<f64>Loss scaling for mixed precision training
dynamic_loss_scaling: boolDynamic loss scaling (adjust based on gradients)
Implementations§
Source§impl PrecisionConfig
impl PrecisionConfig
Sourcepub fn mixed_precision() -> Self
pub fn mixed_precision() -> Self
Create a configuration for mixed precision training.
Sourcepub fn with_auto_mixed_precision(self, enable: bool) -> Self
pub fn with_auto_mixed_precision(self, enable: bool) -> Self
Enable automatic mixed precision.
Sourcepub fn with_loss_scale(self, scale: f64) -> Self
pub fn with_loss_scale(self, scale: f64) -> Self
Set the loss scale for mixed precision training.
Sourcepub fn with_dynamic_loss_scaling(self, enable: bool) -> Self
pub fn with_dynamic_loss_scaling(self, enable: bool) -> Self
Enable dynamic loss scaling.
Trait Implementations§
Source§impl Clone for PrecisionConfig
impl Clone for PrecisionConfig
Source§fn clone(&self) -> PrecisionConfig
fn clone(&self) -> PrecisionConfig
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 moreSource§impl Debug for PrecisionConfig
impl Debug for PrecisionConfig
Auto Trait Implementations§
impl Freeze for PrecisionConfig
impl RefUnwindSafe for PrecisionConfig
impl Send for PrecisionConfig
impl Sync for PrecisionConfig
impl Unpin for PrecisionConfig
impl UnwindSafe for PrecisionConfig
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