Skip to main content

QConv2DPerChannel

Struct QConv2DPerChannel 

Source
pub struct QConv2DPerChannel<'a, const C: usize, const KH: usize, const KW: usize, const F: usize, const SH: usize = 1, const SW: usize = 1, const PT: usize = 0, const PB: usize = 0, const PL: usize = 0, const PR: usize = 0> {
    pub weights: &'a [[[[i8; C]; KW]; KH]; F],
    pub biases: Option<&'a [i32; F]>,
    pub input_zero_point: i8,
    pub requantizers: &'a [Requantizer; F],
}
Expand description

QConv2D with one requantizer per filter, the per-channel weight quantization TFLite applies to convolutions (C++ QConv2DPerChannel).

Fields§

§weights: &'a [[[[i8; C]; KW]; KH]; F]

weights[f][kh][kw][c].

§biases: Option<&'a [i32; F]>

One i32 bias per filter, or None.

§input_zero_point: i8

The input tensor’s zero point, which also fills the padding.

§requantizers: &'a [Requantizer; F]

requantizers[f] rescales filter f’s outputs.

Implementations§

Source§

impl<const C: usize, const KH: usize, const KW: usize, const F: usize, const SH: usize, const SW: usize, const PT: usize, const PB: usize, const PL: usize, const PR: usize> QConv2DPerChannel<'_, C, KH, KW, F, SH, SW, PT, PB, PL, PR>

Source

pub fn forward<const H: usize, const W: usize, const OH: usize, const OW: usize>( &self, input: &[[[i8; C]; W]; H], output: &mut [[[i8; F]; OW]; OH], )

One forward pass; see QConv2D::forward.

Trait Implementations§

Source§

impl<'a, const C: usize, const KH: usize, const KW: usize, const F: usize, const SH: usize, const SW: usize, const PT: usize, const PB: usize, const PL: usize, const PR: usize> Clone for QConv2DPerChannel<'a, C, KH, KW, F, SH, SW, PT, PB, PL, PR>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, const C: usize, const KH: usize, const KW: usize, const F: usize, const SH: usize, const SW: usize, const PT: usize, const PB: usize, const PL: usize, const PR: usize> Copy for QConv2DPerChannel<'a, C, KH, KW, F, SH, SW, PT, PB, PL, PR>

Source§

impl<'a, const C: usize, const KH: usize, const KW: usize, const F: usize, const SH: usize, const SW: usize, const PT: usize, const PB: usize, const PL: usize, const PR: usize> Debug for QConv2DPerChannel<'a, C, KH, KW, F, SH, SW, PT, PB, PL, PR>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, const C: usize, const KH: usize, const KW: usize, const F: usize, const SH: usize, const SW: usize, const PT: usize, const PB: usize, const PL: usize, const PR: usize> Forget for QConv2DPerChannel<'a, C, KH, KW, F, SH, SW, PT, PB, PL, PR>

§

impl<'a, const C: usize, const KH: usize, const KW: usize, const F: usize, const SH: usize, const SW: usize, const PT: usize, const PB: usize, const PL: usize, const PR: usize> Freeze for QConv2DPerChannel<'a, C, KH, KW, F, SH, SW, PT, PB, PL, PR>
where &'a [[[[i8; C]; KW]; KH]; F]: Freeze, Option<&'a [i32; F]>: Freeze, &'a [Requantizer; F]: Freeze,

§

impl<'a, const C: usize, const KH: usize, const KW: usize, const F: usize, const SH: usize, const SW: usize, const PT: usize, const PB: usize, const PL: usize, const PR: usize> RefUnwindSafe for QConv2DPerChannel<'a, C, KH, KW, F, SH, SW, PT, PB, PL, PR>
where &'a [[[[i8; C]; KW]; KH]; F]: RefUnwindSafe, Option<&'a [i32; F]>: RefUnwindSafe, &'a [Requantizer; F]: RefUnwindSafe,

§

impl<'a, const C: usize, const KH: usize, const KW: usize, const F: usize, const SH: usize, const SW: usize, const PT: usize, const PB: usize, const PL: usize, const PR: usize> Send for QConv2DPerChannel<'a, C, KH, KW, F, SH, SW, PT, PB, PL, PR>
where &'a [[[[i8; C]; KW]; KH]; F]: Send, Option<&'a [i32; F]>: Send, &'a [Requantizer; F]: Send,

§

impl<'a, const C: usize, const KH: usize, const KW: usize, const F: usize, const SH: usize, const SW: usize, const PT: usize, const PB: usize, const PL: usize, const PR: usize> Sync for QConv2DPerChannel<'a, C, KH, KW, F, SH, SW, PT, PB, PL, PR>
where &'a [[[[i8; C]; KW]; KH]; F]: Sync, Option<&'a [i32; F]>: Sync, &'a [Requantizer; F]: Sync,

§

impl<'a, const C: usize, const KH: usize, const KW: usize, const F: usize, const SH: usize, const SW: usize, const PT: usize, const PB: usize, const PL: usize, const PR: usize> Unpin for QConv2DPerChannel<'a, C, KH, KW, F, SH, SW, PT, PB, PL, PR>
where &'a [[[[i8; C]; KW]; KH]; F]: Unpin, Option<&'a [i32; F]>: Unpin, &'a [Requantizer; F]: Unpin,

§

impl<'a, const C: usize, const KH: usize, const KW: usize, const F: usize, const SH: usize, const SW: usize, const PT: usize, const PB: usize, const PL: usize, const PR: usize> UnsafeUnpin for QConv2DPerChannel<'a, C, KH, KW, F, SH, SW, PT, PB, PL, PR>
where &'a [[[[i8; C]; KW]; KH]; F]: UnsafeUnpin, Option<&'a [i32; F]>: UnsafeUnpin, &'a [Requantizer; F]: UnsafeUnpin,

§

impl<'a, const C: usize, const KH: usize, const KW: usize, const F: usize, const SH: usize, const SW: usize, const PT: usize, const PB: usize, const PL: usize, const PR: usize> UnwindSafe for QConv2DPerChannel<'a, C, KH, KW, F, SH, SW, PT, PB, PL, PR>
where &'a [[[[i8; C]; KW]; KH]; F]: UnwindSafe, Option<&'a [i32; F]>: UnwindSafe, &'a [Requantizer; F]: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.