pub enum DynamicScaleMode {
MaxAbs,
Percentile(f32),
}Expand description
How to compute the dynamic quantization scale.
Variants§
MaxAbs
Use the max absolute value: scale = max(|x|) / clip_val
Percentile(f32)
Use a percentile of absolute values (more robust to outliers).
percentile in (0, 1] — e.g. 0.99 = 99th percentile
Trait Implementations§
Source§impl Clone for DynamicScaleMode
impl Clone for DynamicScaleMode
Source§fn clone(&self) -> DynamicScaleMode
fn clone(&self) -> DynamicScaleMode
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 moreSource§impl Debug for DynamicScaleMode
impl Debug for DynamicScaleMode
Source§impl PartialEq for DynamicScaleMode
impl PartialEq for DynamicScaleMode
Source§fn eq(&self, other: &DynamicScaleMode) -> bool
fn eq(&self, other: &DynamicScaleMode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for DynamicScaleMode
impl StructuralPartialEq for DynamicScaleMode
Auto Trait Implementations§
impl Freeze for DynamicScaleMode
impl RefUnwindSafe for DynamicScaleMode
impl Send for DynamicScaleMode
impl Sync for DynamicScaleMode
impl Unpin for DynamicScaleMode
impl UnsafeUnpin for DynamicScaleMode
impl UnwindSafe for DynamicScaleMode
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