pub trait WeightProvider: Send + Sync {
// Required methods
fn get_tensor(&self, name: &str) -> Result<Tensor, Error>;
fn has_tensor(&self, name: &str) -> bool;
fn tensor_names(&self) -> Vec<String>;
fn preload(&mut self, names: &[&str]) -> Result<(), Error>;
}Expand description
Trait for providing weights to models
Required Methods§
Sourcefn get_tensor(&self, name: &str) -> Result<Tensor, Error>
fn get_tensor(&self, name: &str) -> Result<Tensor, Error>
Get a tensor by name, loading it if necessary
Sourcefn has_tensor(&self, name: &str) -> bool
fn has_tensor(&self, name: &str) -> bool
Check if a tensor exists
Sourcefn tensor_names(&self) -> Vec<String>
fn tensor_names(&self) -> Vec<String>
Get all tensor names (for config detection)