pub struct GraphOptimizer { /* private fields */ }Expand description
Graph optimizer with configurable passes.
Implementations§
Source§impl GraphOptimizer
impl GraphOptimizer
Sourcepub fn with_all_passes() -> Self
pub fn with_all_passes() -> Self
Create an optimizer with all standard passes enabled.
Sourcepub fn aggressive() -> Self
pub fn aggressive() -> Self
Create an optimizer for aggressive optimization.
Sourcepub fn add_pass(&mut self, pass: OptimizationPass)
pub fn add_pass(&mut self, pass: OptimizationPass)
Add an optimization pass.
Sourcepub fn remove_pass(&mut self, pass: OptimizationPass)
pub fn remove_pass(&mut self, pass: OptimizationPass)
Remove an optimization pass.
Sourcepub fn stats(&self) -> &OptimizationStats
pub fn stats(&self) -> &OptimizationStats
Get statistics from the last optimization.
Sourcepub fn clear_caches(&mut self)
pub fn clear_caches(&mut self)
Clear all caches.
Sourcepub fn optimize(&mut self, graph: &EinsumGraph) -> TlBackendResult<EinsumGraph>
pub fn optimize(&mut self, graph: &EinsumGraph) -> TlBackendResult<EinsumGraph>
Optimize a graph with all enabled passes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphOptimizer
impl RefUnwindSafe for GraphOptimizer
impl Send for GraphOptimizer
impl Sync for GraphOptimizer
impl Unpin for GraphOptimizer
impl UnwindSafe for GraphOptimizer
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