pub struct BroadcastProductGeneral {
lhs_permutation: Permutation,
rhs_permutation: Permutation,
lhs_insertions: Vec<usize>,
rhs_insertions: Vec<usize>,
output_sizes: Vec<usize>,
hadamard_product: HadamardProduct,
}Expand description
Permutes the axes of the LHS and RHS tensor, broadcasts into the output shape, and then computes the element-wise product of the two broadcast tensors.
Currently unused due to (limited) unfavorable benchmarking results compared to
StackedTensordotGeneral. An example of a contraction that could theoretically
be performed by this contraction is ij,jk->ijk: the LHS and RHS are both
broadcast into output shape (|i|, |j|, |k|) and then multiplied elementwise.
However, the limited benchmarking performed so far favored iterating along the
j axis and computing the outer products i,k->ik for each subview of the tensors.
Fields§
§lhs_permutation: Permutation§rhs_permutation: Permutation§lhs_insertions: Vec<usize>§rhs_insertions: Vec<usize>§output_sizes: Vec<usize>§hadamard_product: HadamardProductImplementations§
Source§impl BroadcastProductGeneral
impl BroadcastProductGeneral
pub fn new(sc: &SizedContraction) -> Self
Trait Implementations§
Source§impl Clone for BroadcastProductGeneral
impl Clone for BroadcastProductGeneral
Source§fn clone(&self) -> BroadcastProductGeneral
fn clone(&self) -> BroadcastProductGeneral
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 Debug for BroadcastProductGeneral
impl Debug for BroadcastProductGeneral
Source§impl<A> PairContractor<A> for BroadcastProductGeneral
impl<A> PairContractor<A> for BroadcastProductGeneral
fn contract_pair<'a, 'b, 'c, 'd>(
&self,
lhs: &'b ArrayViewD<'a, A>,
rhs: &'d ArrayViewD<'c, A>,
) -> ArrayD<A>where
A: Clone + LinalgScalar,
'a: 'b,
'c: 'd,
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: Clone + LinalgScalar,
'a: 'b,
'c: 'd,
'e: 'f,
Auto Trait Implementations§
impl Freeze for BroadcastProductGeneral
impl RefUnwindSafe for BroadcastProductGeneral
impl Send for BroadcastProductGeneral
impl Sync for BroadcastProductGeneral
impl Unpin for BroadcastProductGeneral
impl UnwindSafe for BroadcastProductGeneral
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