pub enum SparseModel {
Llama(LlamaModel),
LFM2(LFM2Model),
Bert(BertModel),
}Variants§
Trait Implementations§
Source§impl ModelRunner for SparseModel
impl ModelRunner for SparseModel
Source§fn forward(
&self,
input: &ModelInput,
config: &InferenceConfig,
) -> Result<ModelOutput, SparseInferenceError>
fn forward( &self, input: &ModelInput, config: &InferenceConfig, ) -> Result<ModelOutput, SparseInferenceError>
Forward pass with optional sparse computation
Source§fn get_predictor(&self, layer_idx: usize) -> Option<&LowRankPredictor>
fn get_predictor(&self, layer_idx: usize) -> Option<&LowRankPredictor>
Get predictor for a specific layer (if available)
Source§fn calibrate(
&mut self,
samples: &[ModelInput],
) -> Result<CalibrationStats, SparseInferenceError>
fn calibrate( &mut self, samples: &[ModelInput], ) -> Result<CalibrationStats, SparseInferenceError>
Calibrate predictors with sample data
Source§fn metadata(&self) -> &ModelMetadata
fn metadata(&self) -> &ModelMetadata
Get model metadata
Auto Trait Implementations§
impl Freeze for SparseModel
impl RefUnwindSafe for SparseModel
impl Send for SparseModel
impl Sync for SparseModel
impl Unpin for SparseModel
impl UnwindSafe for SparseModel
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