pub struct TensordotGeneral {
lhs_permutation: Permutation,
rhs_permutation: Permutation,
tensordot_fixed_position: TensordotFixedPosition,
output_permutation: Permutation,
}Expand description
Computes the tensor dot product of two tensors, with individual permutations of the LHS and RHS performed as necessary, as well as a final permutation of the output.
Examples that qualify for TensordotGeneral but not TensordotFixedPosition:
jik,jkl->ilLHS tensor needs to be permutedjik->ijkijk,klm->imljOutput tensor needs to be permutedijlm->imlj
Fields§
§lhs_permutation: Permutation§rhs_permutation: Permutation§tensordot_fixed_position: TensordotFixedPosition§output_permutation: PermutationImplementations§
Source§impl TensordotGeneral
impl TensordotGeneral
pub fn new(sc: &SizedContraction) -> Self
fn from_shapes_and_indices( lhs_shape: &[usize], rhs_shape: &[usize], lhs_indices: &[char], rhs_indices: &[char], contracted_indices: &[char], output_indices: &[char], ) -> Self
Sourcepub fn from_shapes_and_axis_numbers(
lhs_shape: &[usize],
rhs_shape: &[usize],
lhs_axes: &[usize],
rhs_axes: &[usize],
output_order: &[usize],
) -> Self
pub fn from_shapes_and_axis_numbers( lhs_shape: &[usize], rhs_shape: &[usize], lhs_axes: &[usize], rhs_axes: &[usize], output_order: &[usize], ) -> Self
Produces a TensordotGeneral from the shapes and list of axes to be contracted.
Wrapped by the public tensordot function and used by TensordotGeneral::new().
lhs_axes lists the axes from the lhs tensor to contract and rhs_axes lists the
axes from the rhs tensor to contract.
Trait Implementations§
Source§impl Clone for TensordotGeneral
impl Clone for TensordotGeneral
Source§fn clone(&self) -> TensordotGeneral
fn clone(&self) -> TensordotGeneral
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 TensordotGeneral
impl Debug for TensordotGeneral
Source§impl<A> PairContractor<A> for TensordotGeneral
impl<A> PairContractor<A> for TensordotGeneral
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 TensordotGeneral
impl RefUnwindSafe for TensordotGeneral
impl Send for TensordotGeneral
impl Sync for TensordotGeneral
impl Unpin for TensordotGeneral
impl UnwindSafe for TensordotGeneral
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