pub struct QuantizedMaxPool2d { /* private fields */ }Expand description
Quantized Max Pooling 2D
Operates directly in INT8 domain without scale changes. Output has the same scale and zero-point as input.
Implementations§
Source§impl QuantizedMaxPool2d
impl QuantizedMaxPool2d
Sourcepub fn new(kernel_size: usize, stride: usize, padding: usize) -> Self
pub fn new(kernel_size: usize, stride: usize, padding: usize) -> Self
Create a new quantized max pooling layer
Sourcepub fn forward_int8(
&self,
input: &[u8],
input_shape: &[usize],
scale: f32,
zero_point: u8,
) -> CnnResult<(Vec<u8>, Vec<usize>, f32, u8)>
pub fn forward_int8( &self, input: &[u8], input_shape: &[usize], scale: f32, zero_point: u8, ) -> CnnResult<(Vec<u8>, Vec<usize>, f32, u8)>
Forward pass with INT8 input
§Arguments
input- Quantized u8 input tensor (NHWC layout)input_shape- Input shape [N, H, W, C]scale- Input/output scale (unchanged)zero_point- Input/output zero point (unchanged)
Trait Implementations§
Source§impl Clone for QuantizedMaxPool2d
impl Clone for QuantizedMaxPool2d
Source§fn clone(&self) -> QuantizedMaxPool2d
fn clone(&self) -> QuantizedMaxPool2d
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 QuantizedMaxPool2d
impl RefUnwindSafe for QuantizedMaxPool2d
impl Send for QuantizedMaxPool2d
impl Sync for QuantizedMaxPool2d
impl Unpin for QuantizedMaxPool2d
impl UnsafeUnpin for QuantizedMaxPool2d
impl UnwindSafe for QuantizedMaxPool2d
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