Skip to main content

BackendSessionHost

Trait BackendSessionHost 

Source
pub trait BackendSessionHost: BackendRuntimeCache {
    // Provided method
    fn with_backend_session<R>(
        &mut self,
        f: impl FnOnce(&mut dyn BackendSession) -> R + Send,
    ) -> R
       where R: Send,
             Self: Sized + TensorBackend { ... }
}
Expand description

Backend execution-session entry points.

with_backend_session is the canonical user entry; one-shot concrete ops delegate to the session form. with_backend_session_cached is the runtime-cache-aware entry used by the runtime layer.

§Examples

use tenferro_tensor::BackendSessionHost;

fn accepts_session_host<B: BackendSessionHost>(_backend: &mut B) {}

Provided Methods§

Source

fn with_backend_session<R>( &mut self, f: impl FnOnce(&mut dyn BackendSession) -> R + Send, ) -> R
where R: Send, Self: Sized + TensorBackend,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl BackendSessionHost for CpuBackend

Source§

fn with_backend_session<R>( &mut self, f: impl FnOnce(&mut dyn BackendSession) -> R + Send, ) -> R
where R: Send,

§

impl BackendSessionHost for CudaBackend

§

fn with_backend_session<R>( &mut self, f: impl FnOnce(&mut dyn BackendSession) -> R + Send, ) -> R
where R: Send,

§

impl BackendSessionHost for WebGpuBackend

§

fn with_backend_session<R>( &mut self, f: impl FnOnce(&mut dyn BackendSession) -> R + Send, ) -> R
where R: Send,

Implementors§