Skip to main content

WeightLoader

Trait WeightLoader 

Source
pub trait WeightLoader: Send + Sync {
    // Required methods
    fn load_weights(&self, path: &Path) -> Result<ModelWeights>;
    fn supports(&self, path: &Path) -> bool;
    fn format_name(&self) -> &str;
}
Expand description

Core weight loader trait - abstracts loading from different formats

Required Methods§

Source

fn load_weights(&self, path: &Path) -> Result<ModelWeights>

Load weights from path

Source

fn supports(&self, path: &Path) -> bool

Check if this loader supports the given path

Source

fn format_name(&self) -> &str

Get format name

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§