pub struct MemoryOptimizationReport {
pub gradient_checkpoints_added: usize,
pub memory_pools_created: usize,
pub in_place_operations_applied: usize,
pub tensors_reused: usize,
pub lifetime_optimizations: usize,
pub estimated_memory_savings: usize,
}Expand description
Report of memory optimization results
Fields§
§gradient_checkpoints_added: usizeNumber of gradient checkpoints added
memory_pools_created: usizeNumber of memory pools created
in_place_operations_applied: usizeNumber of in-place operations applied
tensors_reused: usizeNumber of tensors reused
lifetime_optimizations: usizeNumber of lifetime optimizations
estimated_memory_savings: usizeEstimated memory savings (bytes)
Implementations§
Source§impl MemoryOptimizationReport
impl MemoryOptimizationReport
Sourcepub fn total_optimizations(&self) -> usize
pub fn total_optimizations(&self) -> usize
Get total optimizations applied
Sourcepub fn print_summary(&self)
pub fn print_summary(&self)
Print a summary of the memory optimization results
Trait Implementations§
Source§impl Clone for MemoryOptimizationReport
impl Clone for MemoryOptimizationReport
Source§fn clone(&self) -> MemoryOptimizationReport
fn clone(&self) -> MemoryOptimizationReport
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 MemoryOptimizationReport
impl Debug for MemoryOptimizationReport
Source§impl Default for MemoryOptimizationReport
impl Default for MemoryOptimizationReport
Source§fn default() -> MemoryOptimizationReport
fn default() -> MemoryOptimizationReport
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryOptimizationReport
impl RefUnwindSafe for MemoryOptimizationReport
impl Send for MemoryOptimizationReport
impl Sync for MemoryOptimizationReport
impl Unpin for MemoryOptimizationReport
impl UnsafeUnpin for MemoryOptimizationReport
impl UnwindSafe for MemoryOptimizationReport
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