pub struct QuantizationConfig { /* private fields */ }Expand description
Quantization configuration
Implementations§
Source§impl QuantizationConfig
impl QuantizationConfig
Sourcepub fn new(
strategy: QuantizationStrategy,
precision: QuantizationPrecision,
) -> Self
pub fn new( strategy: QuantizationStrategy, precision: QuantizationPrecision, ) -> Self
Create a new quantization configuration
Sourcepub fn ultra_fast() -> Self
pub fn ultra_fast() -> Self
Create a configuration for ultra-low latency inference
Sourcepub fn outlier_aware() -> Self
pub fn outlier_aware() -> Self
Create a configuration for models with activation outliers
Sourcepub fn set_target_size_mb(self, size_mb: f32) -> Self
pub fn set_target_size_mb(self, size_mb: f32) -> Self
Set target model size in MB
Sourcepub fn set_performance_threshold(self, threshold: f32) -> Self
pub fn set_performance_threshold(self, threshold: f32) -> Self
Set performance threshold (minimum speedup factor)
Sourcepub fn set_accuracy_threshold(self, threshold: f32) -> Self
pub fn set_accuracy_threshold(self, threshold: f32) -> Self
Set accuracy threshold (minimum accuracy retention)
Sourcepub fn enable_auto_select(self) -> Self
pub fn enable_auto_select(self) -> Self
Enable automatic strategy selection
pub fn strategy(&self) -> QuantizationStrategy
pub fn precision(&self) -> QuantizationPrecision
pub fn target_size_mb(&self) -> f32
pub fn performance_threshold(&self) -> f32
pub fn accuracy_threshold(&self) -> f32
pub fn auto_select(&self) -> bool
Trait Implementations§
Source§impl Clone for QuantizationConfig
impl Clone for QuantizationConfig
Source§fn clone(&self) -> QuantizationConfig
fn clone(&self) -> QuantizationConfig
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 moreSource§impl Debug for QuantizationConfig
impl Debug for QuantizationConfig
Source§impl From<QuantizationConfig> for JsValue
impl From<QuantizationConfig> for JsValue
Source§fn from(value: QuantizationConfig) -> Self
fn from(value: QuantizationConfig) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for QuantizationConfig
impl FromWasmAbi for QuantizationConfig
Source§impl IntoWasmAbi for QuantizationConfig
impl IntoWasmAbi for QuantizationConfig
Source§impl RefFromWasmAbi for QuantizationConfig
impl RefFromWasmAbi for QuantizationConfig
Source§type Anchor = RcRef<QuantizationConfig>
type Anchor = RcRef<QuantizationConfig>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl TryFromJsValue for QuantizationConfig
impl TryFromJsValue for QuantizationConfig
Source§impl VectorFromWasmAbi for QuantizationConfig
impl VectorFromWasmAbi for QuantizationConfig
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[QuantizationConfig]>
Source§impl VectorIntoWasmAbi for QuantizationConfig
impl VectorIntoWasmAbi for QuantizationConfig
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[QuantizationConfig]>) -> Self::Abi
Source§impl WasmDescribeVector for QuantizationConfig
impl WasmDescribeVector for QuantizationConfig
impl SupportsConstructor for QuantizationConfig
impl SupportsInstanceProperty for QuantizationConfig
impl SupportsStaticProperty for QuantizationConfig
Auto Trait Implementations§
impl Freeze for QuantizationConfig
impl RefUnwindSafe for QuantizationConfig
impl Send for QuantizationConfig
impl Sync for QuantizationConfig
impl Unpin for QuantizationConfig
impl UnsafeUnpin for QuantizationConfig
impl UnwindSafe for QuantizationConfig
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> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.