pub struct EinsumPlan { /* private fields */ }Expand description
A reusable einsum expression with fixed input shapes, strides and storage types.
Implementations§
Source§impl EinsumPlan
impl EinsumPlan
pub fn new(expression: &str, inputs: &[TensorDescriptor]) -> Result<Self>
pub fn with_options( expression: &str, inputs: &[TensorDescriptor], output_dtype: DType, compute: ComputeType, ) -> Result<Self>
pub fn expression(&self) -> &str
pub fn plan(&self) -> &Plan
pub fn output(&self) -> &TensorDescriptor
Sourcepub fn optimize(self) -> Result<Self>
pub fn optimize(self) -> Result<Self>
Choose a minimum-product binary contraction tree by exhaustive subset dynamic programming. Search is exponential in operand count. Reassociation changes floating-point operation order; intermediates use the declared compute dtype and only the final output is cast to its dtype.
pub fn planned_scalar_products(&self) -> Option<u128>
pub fn execute<R: Runtime>( &self, inputs: &[&RudaTensor<R>], ) -> Result<RudaTensor<R>>
pub fn execute_into<R: Runtime>( &self, inputs: &[&RudaTensor<R>], output: RudaTensor<R>, ) -> Result<RudaTensor<R>>
Trait Implementations§
Source§impl Clone for EinsumPlan
impl Clone for EinsumPlan
Auto Trait Implementations§
impl Freeze for EinsumPlan
impl RefUnwindSafe for EinsumPlan
impl Send for EinsumPlan
impl Sync for EinsumPlan
impl Unpin for EinsumPlan
impl UnsafeUnpin for EinsumPlan
impl UnwindSafe for EinsumPlan
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