pub struct PerChannelQuantParams {
pub scales: Vec<f32>,
pub zero_points: Vec<i8>,
pub num_channels: usize,
}Expand description
Per-channel quantization parameters
Fields§
§scales: Vec<f32>Per-channel scales
zero_points: Vec<i8>Per-channel zero points
num_channels: usizeNumber of channels
Implementations§
Source§impl PerChannelQuantParams
impl PerChannelQuantParams
Sourcepub fn symmetric_per_channel(
weights: &[f32],
out_channels: usize,
in_channels: usize,
) -> Self
pub fn symmetric_per_channel( weights: &[f32], out_channels: usize, in_channels: usize, ) -> Self
Compute per-channel symmetric quantization params
Sourcepub fn channel_params(&self, channel: usize) -> QuantParams
pub fn channel_params(&self, channel: usize) -> QuantParams
Get params for a specific channel
Trait Implementations§
Source§impl Clone for PerChannelQuantParams
impl Clone for PerChannelQuantParams
Source§fn clone(&self) -> PerChannelQuantParams
fn clone(&self) -> PerChannelQuantParams
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 moreAuto Trait Implementations§
impl Freeze for PerChannelQuantParams
impl RefUnwindSafe for PerChannelQuantParams
impl Send for PerChannelQuantParams
impl Sync for PerChannelQuantParams
impl Unpin for PerChannelQuantParams
impl UnsafeUnpin for PerChannelQuantParams
impl UnwindSafe for PerChannelQuantParams
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