Skip to main content

TlExecutor

Trait TlExecutor 

Source
pub trait TlExecutor {
    type Tensor;
    type Error;

    // Required methods
    fn einsum(
        &mut self,
        spec: &str,
        inputs: &[Self::Tensor],
    ) -> Result<Self::Tensor, Self::Error>;
    fn elem_op(
        &mut self,
        op: ElemOp,
        x: &Self::Tensor,
    ) -> Result<Self::Tensor, Self::Error>;
    fn elem_op_binary(
        &mut self,
        op: ElemOp,
        x: &Self::Tensor,
        y: &Self::Tensor,
    ) -> Result<Self::Tensor, Self::Error>;
    fn reduce(
        &mut self,
        op: ReduceOp,
        x: &Self::Tensor,
        axes: &[usize],
    ) -> Result<Self::Tensor, Self::Error>;
}
Expand description

Core tensor execution interface.

Implementations provide the fundamental tensor operations required for executing compiled TensorLogic programs.

Required Associated Types§

Required Methods§

Source

fn einsum( &mut self, spec: &str, inputs: &[Self::Tensor], ) -> Result<Self::Tensor, Self::Error>

Execute an einsum operation on input tensors.

Source

fn elem_op( &mut self, op: ElemOp, x: &Self::Tensor, ) -> Result<Self::Tensor, Self::Error>

Apply an element-wise unary operation.

Source

fn elem_op_binary( &mut self, op: ElemOp, x: &Self::Tensor, y: &Self::Tensor, ) -> Result<Self::Tensor, Self::Error>

Apply an element-wise binary operation.

Source

fn reduce( &mut self, op: ReduceOp, x: &Self::Tensor, axes: &[usize], ) -> Result<Self::Tensor, Self::Error>

Reduce a tensor along specified axes.

Implementors§