pub struct QuantizationAwareTraining { /* private fields */ }Expand description
Quantization-aware training (QAT)
Simulates quantization during training to make the model robust to quantization errors.
Implementations§
Source§impl QuantizationAwareTraining
impl QuantizationAwareTraining
pub fn new(config: QuantizationConfig) -> Self
Sourcepub fn fake_quantize(&self, tensor: &Tensor) -> Tensor
pub fn fake_quantize(&self, tensor: &Tensor) -> Tensor
Apply fake quantization (quantize then dequantize)
Sourcepub fn set_fake_quantize(&mut self, enabled: bool)
pub fn set_fake_quantize(&mut self, enabled: bool)
Enable/disable fake quantization
Auto Trait Implementations§
impl Freeze for QuantizationAwareTraining
impl RefUnwindSafe for QuantizationAwareTraining
impl Send for QuantizationAwareTraining
impl Sync for QuantizationAwareTraining
impl Unpin for QuantizationAwareTraining
impl UnwindSafe for QuantizationAwareTraining
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