pub struct PairwiseStepPlan<'a> { /* private fields */ }Expand description
Read-only lowering data for one pairwise contraction step.
§Examples
use tenferro_einsum::{ContractionTree, Subscripts};
let subs = Subscripts::new(&[&[0, 1], &[1, 2]], &[0, 2]);
let tree = ContractionTree::from_pairs(&subs, &[&[2, 3], &[3, 4]], &[(0, 1)]).unwrap();
let step = tree.step_plan(0).unwrap();
assert_eq!(step.gemm().contracted_modes(), &[1]);Implementations§
Source§impl<'a> PairwiseStepPlan<'a>
impl<'a> PairwiseStepPlan<'a>
Sourcepub fn lhs_diag(&self) -> Option<DiagPlan<'a>>
pub fn lhs_diag(&self) -> Option<DiagPlan<'a>>
Return the left operand diagonal extraction plan, if any.
§Examples
use tenferro_einsum::{ContractionTree, Subscripts};
let subs = Subscripts::new(&[&[0, 1], &[1, 2]], &[0, 2]);
let tree = ContractionTree::from_pairs(&subs, &[&[2, 3], &[3, 4]], &[(0, 1)]).unwrap();
assert!(tree.step_plan(0).unwrap().lhs_diag().is_none());Sourcepub fn rhs_diag(&self) -> Option<DiagPlan<'a>>
pub fn rhs_diag(&self) -> Option<DiagPlan<'a>>
Return the right operand diagonal extraction plan, if any.
§Examples
use tenferro_einsum::{ContractionTree, Subscripts};
let subs = Subscripts::new(&[&[0, 1], &[1, 2]], &[0, 2]);
let tree = ContractionTree::from_pairs(&subs, &[&[2, 3], &[3, 4]], &[(0, 1)]).unwrap();
assert!(tree.step_plan(0).unwrap().rhs_diag().is_none());Sourcepub fn lhs_reduce(&self) -> Option<ReducePlan<'a>>
pub fn lhs_reduce(&self) -> Option<ReducePlan<'a>>
Return the left operand pre-reduction plan, if any.
§Examples
use tenferro_einsum::{ContractionTree, Subscripts};
let subs = Subscripts::new(&[&[0, 1], &[1, 2]], &[2]);
let tree = ContractionTree::from_pairs(&subs, &[&[2, 3], &[3, 4]], &[(0, 1)]).unwrap();
let reduce = tree.step_plan(0).unwrap().lhs_reduce().unwrap();
assert_eq!(reduce.kept_subs(), &[1]);Sourcepub fn rhs_reduce(&self) -> Option<ReducePlan<'a>>
pub fn rhs_reduce(&self) -> Option<ReducePlan<'a>>
Return the right operand pre-reduction plan, if any.
§Examples
use tenferro_einsum::{ContractionTree, Subscripts};
let subs = Subscripts::new(&[&[0, 1], &[1, 2]], &[0]);
let tree = ContractionTree::from_pairs(&subs, &[&[2, 3], &[3, 4]], &[(0, 1)]).unwrap();
let reduce = tree.step_plan(0).unwrap().rhs_reduce().unwrap();
assert_eq!(reduce.kept_subs(), &[1]);Sourcepub fn gemm(&self) -> GemmPlan<'a>
pub fn gemm(&self) -> GemmPlan<'a>
Return the GEMM decomposition for this pairwise step.
§Examples
use tenferro_einsum::{ContractionTree, Subscripts};
let subs = Subscripts::new(&[&[0, 1], &[1, 2]], &[0, 2]);
let tree = ContractionTree::from_pairs(&subs, &[&[2, 3], &[3, 4]], &[(0, 1)]).unwrap();
let gemm = tree.step_plan(0).unwrap().gemm();
assert_eq!(gemm.output_gemm_shape(), &[2, 4]);Trait Implementations§
Source§impl<'a> Clone for PairwiseStepPlan<'a>
impl<'a> Clone for PairwiseStepPlan<'a>
Source§fn clone(&self) -> PairwiseStepPlan<'a>
fn clone(&self) -> PairwiseStepPlan<'a>
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<'a> Debug for PairwiseStepPlan<'a>
impl<'a> Debug for PairwiseStepPlan<'a>
impl<'a> Copy for PairwiseStepPlan<'a>
Auto Trait Implementations§
impl<'a> Freeze for PairwiseStepPlan<'a>
impl<'a> RefUnwindSafe for PairwiseStepPlan<'a>
impl<'a> Send for PairwiseStepPlan<'a>
impl<'a> Sync for PairwiseStepPlan<'a>
impl<'a> Unpin for PairwiseStepPlan<'a>
impl<'a> UnsafeUnpin for PairwiseStepPlan<'a>
impl<'a> UnwindSafe for PairwiseStepPlan<'a>
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,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
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