Skip to main content

DummyExecutor

Struct DummyExecutor 

Source
pub struct DummyExecutor {
    pub tensors: HashMap<String, DummyTensor>,
    /* private fields */
}
Expand description

Minimal executor implementation for testing and prototyping.

This provides a simple, reference implementation that verifies the execution logic without requiring heavy dependencies.

Fields§

§tensors: HashMap<String, DummyTensor>

Implementations§

Source§

impl DummyExecutor

Source

pub fn new() -> Self

Source

pub fn add_tensor(&mut self, name: impl Into<String>, tensor: DummyTensor)

Source

pub fn get_tensor(&self, name: &str) -> Option<&DummyTensor>

Trait Implementations§

Source§

impl Default for DummyExecutor

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl TlAutodiff for DummyExecutor

Source§

type Tape = HashMap<usize, DummyTensor>

Source§

fn forward(&mut self, graph: &EinsumGraph) -> Result<Self::Tensor, Self::Error>

Execute forward pass on an EinsumGraph.
Source§

fn backward( &mut self, graph: &EinsumGraph, _loss: &Self::Tensor, ) -> Result<Self::Tape, Self::Error>

Execute backward pass to compute gradients.
Source§

impl TlBatchExecutor for DummyExecutor

Source§

type Tensor = DummyTensor

Source§

type Error = ExecutorError

Source§

fn execute_batch( &mut self, graph: &EinsumGraph, batch_inputs: Vec<Vec<Self::Tensor>>, ) -> Result<BatchResult<Self::Tensor>, Self::Error>

Execute a graph on a batch of inputs
Source§

fn execute_batch_parallel( &mut self, graph: &EinsumGraph, batch_inputs: Vec<Vec<Self::Tensor>>, _num_threads: Option<usize>, ) -> Result<BatchResult<Self::Tensor>, Self::Error>

Execute a graph on a batch of inputs with parallel processing
Source§

fn optimal_batch_size(&self) -> usize

Get optimal batch size for this executor
Source§

fn max_batch_size(&self) -> Option<usize>

Get maximum recommended batch size for this executor
Source§

impl TlCapabilities for DummyExecutor

Source§

fn capabilities(&self) -> &BackendCapabilities

Get backend capabilities
Source§

fn supports_elem_op(&self, _op: ElemOp) -> bool

Check if a specific operation is supported
Source§

fn supports_reduce_op(&self, _op: ReduceOp) -> bool

Check if a specific reduction operation is supported
Source§

fn supports_einsum(&self, _spec: &str) -> bool

Check if einsum is supported with the given spec
Source§

fn available_devices(&self) -> Vec<DeviceType>

Get available devices
Source§

fn default_device(&self) -> DeviceType

Get default device
Source§

impl TlExecutor for DummyExecutor

Source§

type Tensor = DummyTensor

Source§

type Error = ExecutorError

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.
Source§

impl TlProfiledExecutor for DummyExecutor

Source§

fn profiler(&self) -> Option<&Profiler>

Get the current profiler
Source§

fn profiler_mut(&mut self) -> Option<&mut Profiler>

Get mutable access to profiler
Source§

fn enable_profiling(&mut self)

Enable profiling
Source§

fn disable_profiling(&mut self)

Disable profiling
Source§

fn get_profile_data(&self) -> Option<&ProfileData>

Get profiling data

Auto Trait Implementations§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V