pub struct QuantConfigBuilder { /* private fields */ }Expand description
Configuration builder for specific quantization backends
Implementations§
Source§impl QuantConfigBuilder
impl QuantConfigBuilder
Sourcepub fn observer(self, observer_type: ObserverType) -> Self
pub fn observer(self, observer_type: ObserverType) -> Self
Set the observer type
Sourcepub fn backend(self, backend: QuantBackend) -> Self
pub fn backend(self, backend: QuantBackend) -> Self
Set the backend
Sourcepub fn fake_quant(self, enable: bool) -> Self
pub fn fake_quant(self, enable: bool) -> Self
Enable/disable fake quantization
Sourcepub fn channel_axis(self, axis: usize) -> Self
pub fn channel_axis(self, axis: usize) -> Self
Set channel axis for per-channel quantization
Sourcepub fn group_size(self, size: usize) -> Self
pub fn group_size(self, size: usize) -> Self
Set group size for group-wise quantization
Sourcepub fn build(self) -> TorshResult<QuantConfig>
pub fn build(self) -> TorshResult<QuantConfig>
Build the final configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QuantConfigBuilder
impl RefUnwindSafe for QuantConfigBuilder
impl Send for QuantConfigBuilder
impl Sync for QuantConfigBuilder
impl Unpin for QuantConfigBuilder
impl UnsafeUnpin for QuantConfigBuilder
impl UnwindSafe for QuantConfigBuilder
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