pub struct SmoothQuantConfig {
pub alpha: f32,
pub epsilon: f32,
}Expand description
SmoothQuant configuration: redistribute quantization difficulty from activations to weights.
Smoothing factor: s_j = max(|A_j|)^α / max(|W_j|)^(1-α)
Then: Ã = A / s, W̃ = W * s
Fields§
§alpha: f32Balance factor in [0, 1]. Typically 0.5.
epsilon: f32Floor for scale values to avoid division by zero.
Implementations§
Source§impl SmoothQuantConfig
impl SmoothQuantConfig
Sourcepub fn default_alpha() -> Self
pub fn default_alpha() -> Self
Default config with alpha = 0.5.
Trait Implementations§
Source§impl Clone for SmoothQuantConfig
impl Clone for SmoothQuantConfig
Source§fn clone(&self) -> SmoothQuantConfig
fn clone(&self) -> SmoothQuantConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SmoothQuantConfig
impl RefUnwindSafe for SmoothQuantConfig
impl Send for SmoothQuantConfig
impl Sync for SmoothQuantConfig
impl Unpin for SmoothQuantConfig
impl UnsafeUnpin for SmoothQuantConfig
impl UnwindSafe for SmoothQuantConfig
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> 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