[−][src]Struct ndarray_einsum_beta::contractors::PairContraction
Holds a Box
ed PairContractor
trait object and two Option<Box>
ed simplifications for the LHS and RHS tensors.
For example, the contraction ijk,kj->jk
will currently be performed as follows:
- Simplify the LHS with the contraction
ijk->jk
- Don't simplify the RHS
- Use HadamardProductGeneral to compute
jk,kj->jk
A second example is the contraction iij,jkk->ik
:
- Simplify the LHS with the contraction
iij->ij
- Simplify the RHS with the contraction
jkk->jk
- Use TensordotGeneral to compute
ij,jk->ik
Since the axis lengths aren't known until runtime, and the actual einsum string may not be either, it is generally not possible to know at compile time which specific PairContractor will be used to perform a given contraction, or even which contractions will be performed; the optimizer could choose a different order.
Fields
lhs_simplification: Option<SimplificationMethodAndOutput<A>>
rhs_simplification: Option<SimplificationMethodAndOutput<A>>
method: PairMethod
op: Box<dyn PairContractor<A>>
simplified_einsum_string: String
Methods
impl<A> PairContraction<A>
[src]
pub fn new(sc: &SizedContraction) -> Self
[src]
Trait Implementations
impl<A> PairContractor<A> for PairContraction<A>
[src]
fn contract_pair<'a, 'b, 'c, 'd>(
&self,
lhs: &'b ArrayViewD<'a, A>,
rhs: &'d ArrayViewD<'c, A>
) -> ArrayD<A> where
'a: 'b,
'c: 'd,
A: Clone + LinalgScalar,
[src]
&self,
lhs: &'b ArrayViewD<'a, A>,
rhs: &'d ArrayViewD<'c, A>
) -> ArrayD<A> where
'a: 'b,
'c: 'd,
A: Clone + LinalgScalar,
fn contract_and_assign_pair<'a, 'b, 'c, 'd, 'e, 'f>(
&self,
lhs: &'b ArrayViewD<'a, A>,
rhs: &'d ArrayViewD<'c, A>,
out: &'f mut ArrayViewMutD<'e, A>
) where
'a: 'b,
'c: 'd,
'e: 'f,
A: Clone + LinalgScalar,
[src]
&self,
lhs: &'b ArrayViewD<'a, A>,
rhs: &'d ArrayViewD<'c, A>,
out: &'f mut ArrayViewMutD<'e, A>
) where
'a: 'b,
'c: 'd,
'e: 'f,
A: Clone + LinalgScalar,
impl<A> Debug for PairContraction<A>
[src]
Auto Trait Implementations
impl<A> !Send for PairContraction<A>
impl<A> !Sync for PairContraction<A>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,