pub struct MemoryOptimizer<F: Float> { /* private fields */ }Expand description
Memory optimizer for computation graphs
Implementations§
Source§impl<F: Float> MemoryOptimizer<F>
impl<F: Float> MemoryOptimizer<F>
Sourcepub fn with_config(config: MemoryOptimizationConfig) -> Self
pub fn with_config(config: MemoryOptimizationConfig) -> Self
Create a memory optimizer with custom configuration
Sourcepub fn optimize(
&mut self,
graph: &mut Graph<F>,
) -> Result<MemoryOptimizationReport, OptimizationError>
pub fn optimize( &mut self, graph: &mut Graph<F>, ) -> Result<MemoryOptimizationReport, OptimizationError>
Optimize memory usage in a computation graph
Sourcepub fn get_analysis(&self) -> Option<&MemoryAnalysis>
pub fn get_analysis(&self) -> Option<&MemoryAnalysis>
Get the current memory analysis
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for MemoryOptimizer<F>
impl<F> RefUnwindSafe for MemoryOptimizer<F>where
F: RefUnwindSafe,
impl<F> Send for MemoryOptimizer<F>
impl<F> Sync for MemoryOptimizer<F>
impl<F> Unpin for MemoryOptimizer<F>where
F: Unpin,
impl<F> UnsafeUnpin for MemoryOptimizer<F>
impl<F> UnwindSafe for MemoryOptimizer<F>where
F: UnwindSafe,
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> 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