Skip to main content

ExtensionRuntime

Trait ExtensionRuntime 

Source
pub trait ExtensionRuntime<B>:
    Debug
    + Send
    + Sync
    + 'static
where B: TensorBackend + 'static,
{ // Required methods fn family_id(&self) -> &'static str; fn execute( &self, op: &(dyn ExtensionOp + 'static), inputs: &[&Tensor], ctx: &mut ExtensionExecutionContext<'_, B>, ) -> Result<Vec<Tensor>, Error>; fn execute_reads( &self, op: &(dyn ExtensionOp + 'static), inputs: &[TensorRead<'_>], ctx: &mut ExtensionExecutionContext<'_, B>, ) -> Result<Vec<Tensor>, Error>; }
Expand description

A backend-specific runtime executor for one extension family.

Required Methods§

Source

fn family_id(&self) -> &'static str

Extension family handled by this executor.

Source

fn execute( &self, op: &(dyn ExtensionOp + 'static), inputs: &[&Tensor], ctx: &mut ExtensionExecutionContext<'_, B>, ) -> Result<Vec<Tensor>, Error>

Execute the extension op with backend and cache state supplied by core.

Source

fn execute_reads( &self, op: &(dyn ExtensionOp + 'static), inputs: &[TensorRead<'_>], ctx: &mut ExtensionExecutionContext<'_, B>, ) -> Result<Vec<Tensor>, Error>

Execute the extension op on borrowed tensor reads.

Implementations that need compact tensors must materialize inputs here explicitly. Keeping this method required prevents implicit read-path fallbacks from hiding backend or view handling bugs.

Implementors§