EinsumPath

Struct EinsumPath 

Source
pub struct EinsumPath<A> {
    pub contraction_order: ContractionOrder,
    pub steps: EinsumPathSteps<A>,
}
Expand description

An EinsumPath, returned by einsum_path, represents a fully-prepared plan to perform a tensor contraction.

It contains the order in which the input tensors should be contracted with one another or with one of the previous intermediate results, and for each step in the path, how to perform the pairwise contraction. For example, two tensors might be contracted with one another by computing the Hadamard (element-wise) product of the tensors, while a different pair might be contracted by performing a matrix multiplication. The contractions that will be performed are fully specified within the EinsumPath.

Fields§

§contraction_order: ContractionOrder

The order in which tensors should be paired off and contracted with one another

§steps: EinsumPathSteps<A>

The details of the contractions to be performed

Implementations§

Source§

impl<A> EinsumPath<A>

Source

pub fn new(sc: &SizedContraction) -> Self

Source

pub fn from_path(contraction_order: &ContractionOrder) -> Self

Source§

impl<A> EinsumPath<A>

Source

pub fn contract_operands(&self, operands: &[&dyn ArrayLike<A>]) -> ArrayD<A>
where A: Clone + LinalgScalar,

Trait Implementations§

Source§

impl<A> Debug for EinsumPath<A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<A> Freeze for EinsumPath<A>

§

impl<A> !RefUnwindSafe for EinsumPath<A>

§

impl<A> !Send for EinsumPath<A>

§

impl<A> !Sync for EinsumPath<A>

§

impl<A> Unpin for EinsumPath<A>

§

impl<A> !UnwindSafe for EinsumPath<A>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.