pub struct ModelRegistry { /* private fields */ }Expand description
Model registry for managing all supported architectures
Implementations§
Source§impl ModelRegistry
impl ModelRegistry
pub fn new() -> Self
Sourcepub fn register<F>(&mut self, architecture: &str, factory: F)where
F: ModelFactory + 'static,
pub fn register<F>(&mut self, architecture: &str, factory: F)where
F: ModelFactory + 'static,
Register a model factory
Sourcepub fn create_model(
&self,
architecture: &str,
config_json: &str,
) -> Result<Box<dyn Model<Config = Box<dyn ModelConfig>>>>
pub fn create_model( &self, architecture: &str, config_json: &str, ) -> Result<Box<dyn Model<Config = Box<dyn ModelConfig>>>>
Create model by architecture name
Sourcepub fn supported_architectures(&self) -> Vec<String>
pub fn supported_architectures(&self) -> Vec<String>
Get all supported architectures
Auto Trait Implementations§
impl !RefUnwindSafe for ModelRegistry
impl !UnwindSafe for ModelRegistry
impl Freeze for ModelRegistry
impl Send for ModelRegistry
impl Sync for ModelRegistry
impl Unpin for ModelRegistry
impl UnsafeUnpin for ModelRegistry
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more