pub struct CompressedModel<M: Model> {
pub model: M,
pub compression_techniques: Vec<String>,
pub quantization_config: Option<QuantizationConfig>,
pub pruning_config: Option<UnstructuredPruningConfig>,
pub structured_pruning_config: Option<StructuredPruningConfig>,
pub decomposition_config: Option<DecompositionConfig>,
pub clustering_config: Option<ClusteringConfig>,
pub analysis: Option<CompressionAnalysis>,
}Expand description
Compressed model wrapper
Fields§
§model: MThe underlying model
compression_techniques: Vec<String>Applied compression techniques
quantization_config: Option<QuantizationConfig>Quantization configuration
pruning_config: Option<UnstructuredPruningConfig>Pruning configuration
structured_pruning_config: Option<StructuredPruningConfig>Structured pruning configuration
decomposition_config: Option<DecompositionConfig>Decomposition configuration
clustering_config: Option<ClusteringConfig>Clustering configuration
analysis: Option<CompressionAnalysis>Compression analysis results
Implementations§
Source§impl<M: Model> CompressedModel<M>
impl<M: Model> CompressedModel<M>
Sourcepub fn parameter_count(&self) -> usize
pub fn parameter_count(&self) -> usize
Get parameter count of the model
Sourcepub fn model_size_bytes(&self) -> usize
pub fn model_size_bytes(&self) -> usize
Get model size in bytes
Sourcepub fn is_quantized(&self) -> bool
pub fn is_quantized(&self) -> bool
Check if model is quantized
Sourcepub fn compression_summary(&self) -> CompressionSummary
pub fn compression_summary(&self) -> CompressionSummary
Get compression summary
Auto Trait Implementations§
impl<M> Freeze for CompressedModel<M>where
M: Freeze,
impl<M> RefUnwindSafe for CompressedModel<M>where
M: RefUnwindSafe,
impl<M> Send for CompressedModel<M>
impl<M> Sync for CompressedModel<M>
impl<M> Unpin for CompressedModel<M>where
M: Unpin,
impl<M> UnsafeUnpin for CompressedModel<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for CompressedModel<M>where
M: UnwindSafe,
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
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