pub struct MobileQuantizationEngine { /* private fields */ }Expand description
Advanced mobile quantization engine
Implementations§
Source§impl MobileQuantizationEngine
impl MobileQuantizationEngine
Sourcepub fn new(
config: QuantizationConfig,
device_info: MobileDeviceInfo,
memory_pool: Option<Arc<MobileMemoryPool>>,
) -> Result<Self>
pub fn new( config: QuantizationConfig, device_info: MobileDeviceInfo, memory_pool: Option<Arc<MobileMemoryPool>>, ) -> Result<Self>
Create a new mobile quantization engine
Sourcepub fn set_calibration_data(
&mut self,
dataset: CalibrationDataset,
) -> Result<()>
pub fn set_calibration_data( &mut self, dataset: CalibrationDataset, ) -> Result<()>
Set calibration dataset for quantization
Sourcepub fn quantize_model(
&self,
model_id: &str,
model_data: &[u8],
) -> Result<QuantizedModel>
pub fn quantize_model( &self, model_id: &str, model_data: &[u8], ) -> Result<QuantizedModel>
Quantize model with mobile optimizations
Auto Trait Implementations§
impl Freeze for MobileQuantizationEngine
impl RefUnwindSafe for MobileQuantizationEngine
impl Send for MobileQuantizationEngine
impl Sync for MobileQuantizationEngine
impl Unpin for MobileQuantizationEngine
impl UnsafeUnpin for MobileQuantizationEngine
impl UnwindSafe for MobileQuantizationEngine
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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