pub struct LowRankInferencePass { /* private fields */ }Expand description
Optimization pass that scans an EinsumGraph and annotates Einsum nodes
with low-rank approximation candidates.
Currently uses a heuristic based on einsum spec complexity (number of unique contracted indices) to identify potential candidates.
Implementations§
Source§impl LowRankInferencePass
impl LowRankInferencePass
Sourcepub fn new(config: LowRankConfig) -> Self
pub fn new(config: LowRankConfig) -> Self
Create a new pass with the given configuration.
Sourcepub fn find_candidates(&self, graph: &EinsumGraph) -> Vec<LowRankCandidate>
pub fn find_candidates(&self, graph: &EinsumGraph) -> Vec<LowRankCandidate>
Scan the graph and return a list of low-rank candidates.
Sourcepub fn apply_annotations(&self, graph: &EinsumGraph) -> LowRankPassStats
pub fn apply_annotations(&self, graph: &EinsumGraph) -> LowRankPassStats
Apply annotations and return aggregate stats.
In this implementation the “annotation” is a dry-run analysis only — the graph is not mutated (annotation requires mutable access and is outside the scope of a read-only pass).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LowRankInferencePass
impl RefUnwindSafe for LowRankInferencePass
impl Send for LowRankInferencePass
impl Sync for LowRankInferencePass
impl Unpin for LowRankInferencePass
impl UnsafeUnpin for LowRankInferencePass
impl UnwindSafe for LowRankInferencePass
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