pub struct LayerSensitivityResult {
pub layer_name: String,
pub original_accuracy: f32,
pub quantized_accuracy: f32,
pub sensitivity_score: f32,
pub recommended_scheme: QScheme,
pub keep_fp32: bool,
}Expand description
Results of sensitivity analysis for a single layer
Fields§
§layer_name: StringLayer name or identifier
original_accuracy: f32Original accuracy (before quantization)
quantized_accuracy: f32Accuracy after quantizing this layer
sensitivity_score: f32Sensitivity score (accuracy drop)
recommended_scheme: QSchemeRecommended quantization scheme for this layer
keep_fp32: boolWhether this layer should be kept in full precision
Implementations§
Source§impl LayerSensitivityResult
impl LayerSensitivityResult
Sourcepub fn new(
layer_name: String,
original_accuracy: f32,
quantized_accuracy: f32,
) -> Self
pub fn new( layer_name: String, original_accuracy: f32, quantized_accuracy: f32, ) -> Self
Create a new sensitivity result
Sourcepub fn new_with_config(
layer_name: String,
original_accuracy: f32,
quantized_accuracy: f32,
config: &AnalysisConfig,
) -> Self
pub fn new_with_config( layer_name: String, original_accuracy: f32, quantized_accuracy: f32, config: &AnalysisConfig, ) -> Self
Create a new sensitivity result with custom analysis configuration
Sourcepub fn accuracy_drop_percentage(&self) -> f32
pub fn accuracy_drop_percentage(&self) -> f32
Get the accuracy drop percentage
Sourcepub fn is_high_sensitivity(&self) -> bool
pub fn is_high_sensitivity(&self) -> bool
Check if this layer is highly sensitive to quantization
Sourcepub fn is_high_sensitivity_with_config(&self, config: &AnalysisConfig) -> bool
pub fn is_high_sensitivity_with_config(&self, config: &AnalysisConfig) -> bool
Check if this layer is highly sensitive to quantization with custom config
Trait Implementations§
Source§impl Clone for LayerSensitivityResult
impl Clone for LayerSensitivityResult
Source§fn clone(&self) -> LayerSensitivityResult
fn clone(&self) -> LayerSensitivityResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LayerSensitivityResult
impl RefUnwindSafe for LayerSensitivityResult
impl Send for LayerSensitivityResult
impl Sync for LayerSensitivityResult
impl Unpin for LayerSensitivityResult
impl UnsafeUnpin for LayerSensitivityResult
impl UnwindSafe for LayerSensitivityResult
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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