Skip to main content

RuntimeFactory

Trait RuntimeFactory 

Source
pub trait RuntimeFactory:
    Send
    + Sync
    + 'static {
    // Required methods
    fn create(
        &self,
        intra_threads: usize,
    ) -> Result<Box<dyn Runtime>, RuntimeError>;
    fn cpu_fallback(&self) -> Box<dyn RuntimeFactory>;
}
Expand description

Creates a Runtime configured for a specific execution provider.

Required Methods§

Source

fn create(&self, intra_threads: usize) -> Result<Box<dyn Runtime>, RuntimeError>

Source

fn cpu_fallback(&self) -> Box<dyn RuntimeFactory>

Returns a CPU-only factory suitable for small auxiliary models.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§