pub struct DynamicQuantization { /* private fields */ }Expand description
Dynamic quantization
Quantizes activations dynamically at runtime while keeping weights quantized.
Implementations§
Source§impl DynamicQuantization
impl DynamicQuantization
pub fn new() -> Self
Sourcepub fn quantize_weights(&mut self, name: &str, weights: &Tensor)
pub fn quantize_weights(&mut self, name: &str, weights: &Tensor)
Quantize model weights
Sourcepub fn get_weights(&self, name: &str) -> Option<Tensor>
pub fn get_weights(&self, name: &str) -> Option<Tensor>
Get quantized weights
Sourcepub fn quantize_activation(&self, activation: &Tensor) -> QuantizedTensor
pub fn quantize_activation(&self, activation: &Tensor) -> QuantizedTensor
Quantize activations dynamically
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DynamicQuantization
impl RefUnwindSafe for DynamicQuantization
impl Send for DynamicQuantization
impl Sync for DynamicQuantization
impl Unpin for DynamicQuantization
impl UnwindSafe for DynamicQuantization
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> 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