Skip to main content

ContractBuilder

Trait ContractBuilder 

Source
pub trait ContractBuilder<'a, T, Sa, Sb, La, Lb>
where T: 'a, La: Layout, Lb: Layout,
{ // Required methods fn scale(self, factor: T) -> Self; fn eval(self) -> Array<T, DynRank>; fn write<Sc: Shape, Lc: Layout>(self, c: &mut Slice<T, Sc, Lc>); fn add_to<Sc: Shape, Lc: Layout>(self, c: &mut Slice<T, Sc, Lc>); fn add_to_scaled<Sc: Shape, Lc: Layout>( self, c: &mut Slice<T, Sc, Lc>, beta: T, ); }
Expand description

Builder interface for configuring tensor contraction operations

Required Methods§

Source

fn scale(self, factor: T) -> Self

Multiplies the result by a scalar factor.

Source

fn eval(self) -> Array<T, DynRank>

Returns a new owned tensor containing the result.

Source

fn write<Sc: Shape, Lc: Layout>(self, c: &mut Slice<T, Sc, Lc>)

Overwrites the provided slice with the result.

Source

fn add_to<Sc: Shape, Lc: Layout>(self, c: &mut Slice<T, Sc, Lc>)

Adds the result to the provided slice.

Source

fn add_to_scaled<Sc: Shape, Lc: Layout>(self, c: &mut Slice<T, Sc, Lc>, beta: T)

Adds the result to the provided slice after scaling the slice by beta (i.e. C := beta * C + result).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§