pub struct HostReferenceRuntime<B: TensorBackend + 'static> { /* private fields */ }Expand description
Runtime adapter that delegates execution to an extension op’s optional host/reference implementation.
Register one adapter per extension family. Backend-specific runtimes should
implement ExtensionRuntime directly instead of using this adapter.
§Examples
use tenferro_cpu::CpuBackend;
use tenferro_runtime::{ExtensionRuntime, HostReferenceRuntime};
let runtime = HostReferenceRuntime::<CpuBackend>::new("example.identity.v1");
assert_eq!(runtime.family_id(), "example.identity.v1");Implementations§
Source§impl<B: TensorBackend + 'static> HostReferenceRuntime<B>
impl<B: TensorBackend + 'static> HostReferenceRuntime<B>
Trait Implementations§
Source§impl<B: Clone + TensorBackend + 'static> Clone for HostReferenceRuntime<B>
impl<B: Clone + TensorBackend + 'static> Clone for HostReferenceRuntime<B>
Source§fn clone(&self) -> HostReferenceRuntime<B>
fn clone(&self) -> HostReferenceRuntime<B>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<B: TensorBackend + 'static> Debug for HostReferenceRuntime<B>
impl<B: TensorBackend + 'static> Debug for HostReferenceRuntime<B>
Source§impl<B: TensorBackend + 'static> ExtensionRuntime<B> for HostReferenceRuntime<B>
impl<B: TensorBackend + 'static> ExtensionRuntime<B> for HostReferenceRuntime<B>
Source§fn execute(
&self,
op: &dyn ExtensionOp,
inputs: &[&Tensor],
_ctx: &mut ExtensionExecutionContext<'_, B>,
) -> Result<Vec<Tensor>>
fn execute( &self, op: &dyn ExtensionOp, inputs: &[&Tensor], _ctx: &mut ExtensionExecutionContext<'_, B>, ) -> Result<Vec<Tensor>>
Execute the extension op with backend and cache state supplied by core.
Source§fn execute_reads(
&self,
op: &dyn ExtensionOp,
inputs: &[TensorRead<'_>],
ctx: &mut ExtensionExecutionContext<'_, B>,
) -> Result<Vec<Tensor>>
fn execute_reads( &self, op: &dyn ExtensionOp, inputs: &[TensorRead<'_>], ctx: &mut ExtensionExecutionContext<'_, B>, ) -> Result<Vec<Tensor>>
Execute the extension op on borrowed tensor reads. Read more
impl<B: Copy + TensorBackend + 'static> Copy for HostReferenceRuntime<B>
Auto Trait Implementations§
impl<B> Freeze for HostReferenceRuntime<B>
impl<B> RefUnwindSafe for HostReferenceRuntime<B>
impl<B> Send for HostReferenceRuntime<B>
impl<B> Sync for HostReferenceRuntime<B>
impl<B> Unpin for HostReferenceRuntime<B>
impl<B> UnsafeUnpin for HostReferenceRuntime<B>
impl<B> UnwindSafe for HostReferenceRuntime<B>
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