pub struct QuantizedDepthwiseConv2d { /* private fields */ }Expand description
Quantized Depthwise Convolution Layer
Performs depthwise separable convolution in INT8:
- Each input channel is convolved with a single kernel
- No cross-channel mixing (unlike standard convolution)
- Memory efficient for mobile architectures
Implementations§
Source§impl QuantizedDepthwiseConv2d
impl QuantizedDepthwiseConv2d
Sourcepub fn from_fp32(
channels: usize,
kernel_size: usize,
weights: &[f32],
bias: Option<&[f32]>,
stride: usize,
padding: usize,
input_scale: f32,
) -> Self
pub fn from_fp32( channels: usize, kernel_size: usize, weights: &[f32], bias: Option<&[f32]>, stride: usize, padding: usize, input_scale: f32, ) -> Self
Create from FP32 depthwise convolution
§Arguments
channels- Number of input/output channelskernel_size- Kernel size (assumed square)weights- FP32 weights [channels, kh, kw]bias- Optional FP32 bias [channels]stride- Stridepadding- Paddinginput_scale- Expected input activation scale
Sourcepub fn forward_int8(
&self,
input: &[u8],
input_shape: &[usize],
input_scale: f32,
input_zero_point: u8,
) -> CnnResult<Tensor>
pub fn forward_int8( &self, input: &[u8], input_shape: &[usize], input_scale: f32, input_zero_point: u8, ) -> CnnResult<Tensor>
Forward pass with INT8 computation
§Arguments
input- Quantized u8 input tensor (NHWC layout)input_shape- Input shape [N, H, W, C]input_scale- Input quantization scaleinput_zero_point- Input quantization zero point
Trait Implementations§
Source§impl Clone for QuantizedDepthwiseConv2d
impl Clone for QuantizedDepthwiseConv2d
Source§fn clone(&self) -> QuantizedDepthwiseConv2d
fn clone(&self) -> QuantizedDepthwiseConv2d
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 QuantizedDepthwiseConv2d
impl RefUnwindSafe for QuantizedDepthwiseConv2d
impl Send for QuantizedDepthwiseConv2d
impl Sync for QuantizedDepthwiseConv2d
impl Unpin for QuantizedDepthwiseConv2d
impl UnsafeUnpin for QuantizedDepthwiseConv2d
impl UnwindSafe for QuantizedDepthwiseConv2d
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