pub struct QuantParams {
pub scale: f32,
pub zero_point: i8,
}Expand description
Quantization parameters for INT8 conversion
Fields§
§scale: f32Scale factor for quantization
zero_point: i8Zero point offset
Implementations§
Source§impl QuantParams
impl QuantParams
Sourcepub fn from_tensor(tensor: &[f32]) -> Self
pub fn from_tensor(tensor: &[f32]) -> Self
Compute quantization parameters from a tensor
Trait Implementations§
Source§impl Clone for QuantParams
impl Clone for QuantParams
Source§fn clone(&self) -> QuantParams
fn clone(&self) -> QuantParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QuantParams
impl Debug for QuantParams
Source§impl<'de> Deserialize<'de> for QuantParams
impl<'de> Deserialize<'de> for QuantParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for QuantParams
impl PartialEq for QuantParams
Source§impl Serialize for QuantParams
impl Serialize for QuantParams
impl Copy for QuantParams
impl StructuralPartialEq for QuantParams
Auto Trait Implementations§
impl Freeze for QuantParams
impl RefUnwindSafe for QuantParams
impl Send for QuantParams
impl Sync for QuantParams
impl Unpin for QuantParams
impl UnsafeUnpin for QuantParams
impl UnwindSafe for QuantParams
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