pub struct DynamicQuantizer { /* private fields */ }Expand description
Dynamic quantizer
Implementations§
Source§impl DynamicQuantizer
impl DynamicQuantizer
Sourcepub fn new(qtype: QuantizationType, scheme: QuantizationScheme) -> Self
pub fn new(qtype: QuantizationType, scheme: QuantizationScheme) -> Self
Create a new dynamic quantizer
Sourcepub fn int8_per_tensor() -> Self
pub fn int8_per_tensor() -> Self
Create INT8 per-tensor quantizer
Sourcepub fn int8_per_channel() -> Self
pub fn int8_per_channel() -> Self
Create INT8 per-channel quantizer
Sourcepub fn int4_per_channel() -> Self
pub fn int4_per_channel() -> Self
Create INT4 per-channel quantizer
Sourcepub fn quantize_1d(&self, data: &Array1<f32>) -> CoreResult<QuantizedTensor>
pub fn quantize_1d(&self, data: &Array1<f32>) -> CoreResult<QuantizedTensor>
Quantize a 1D array
Sourcepub fn quantize_2d(&self, data: &Array2<f32>) -> CoreResult<QuantizedTensor>
pub fn quantize_2d(&self, data: &Array2<f32>) -> CoreResult<QuantizedTensor>
Quantize a 2D array
Auto Trait Implementations§
impl Freeze for DynamicQuantizer
impl RefUnwindSafe for DynamicQuantizer
impl Send for DynamicQuantizer
impl Sync for DynamicQuantizer
impl Unpin for DynamicQuantizer
impl UnwindSafe for DynamicQuantizer
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> 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