Skip to main content

IPoolingLayer

Struct IPoolingLayer 

Source
pub struct IPoolingLayer { /* private fields */ }
Expand description

! \class IPoolingLayer ! ! \brief A Pooling layer in a network definition. ! ! The layer applies a reduction operation within a window over the input. ! ! \warning When running pooling layer with DeviceType::kDLA in Int8 mode, the dynamic ranges ! for input and output tensors must be equal. ! ! \warning Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI. !

Implementations§

Source§

impl IPoolingLayer

Source

pub fn setPoolingType(self: Pin<&mut IPoolingLayer>, type_: PoolingType)

! ! \brief Set the type of activation to be performed. ! ! DLA only supports kMAX and kAVERAGE pooling types. ! ! \see getPoolingType(), PoolingType !

Source

pub fn getPoolingType(self: &IPoolingLayer) -> PoolingType

! ! \brief Get the type of activation to be performed. ! ! \see setPoolingType(), PoolingType !

Source

pub fn setBlendFactor(self: Pin<&mut IPoolingLayer>, blendFactor: f32)

! ! \brief Set the blending factor for the max_average_blend mode: ! max_average_blendPool = (1-blendFactor)maxPool + blendFactoravgPool ! blendFactor is a user value in [0,1] with the default value of 0.0 ! This value only applies for the kMAX_AVERAGE_BLEND mode. ! ! Since DLA does not support kMAX_AVERAGE_BLEND, blendFactor is ignored on the DLA. ! ! \see getBlendFactor() !

Source

pub fn getBlendFactor(self: &IPoolingLayer) -> f32

! ! \brief Get the blending factor for the max_average_blend mode: ! max_average_blendPool = (1-blendFactor)maxPool + blendFactoravgPool ! blendFactor is a user value in [0,1] with the default value of 0.0 ! In modes other than kMAX_AVERAGE_BLEND, blendFactor is ignored. ! ! \see setBlendFactor() !

Source

pub fn setAverageCountExcludesPadding( self: Pin<&mut IPoolingLayer>, exclusive: bool, )

! ! \brief Set whether average pooling uses as a denominator the overlap area between the window ! and the unpadded input. ! If this is not set, the denominator is the overlap between the pooling window and the padded input. ! ! Default: true ! ! \see getAverageCountExcludesPadding() !

Source

pub fn getAverageCountExcludesPadding(self: &IPoolingLayer) -> bool

! ! \brief Get whether average pooling uses as a denominator the overlap area between the window ! and the unpadded input. ! ! \see setAverageCountExcludesPadding() !

Source

pub fn setPrePadding(self: Pin<&mut IPoolingLayer>, padding: &Dims64)

! ! \brief Set the multi-dimension pre-padding for pooling. ! ! The start of the input will be padded by this number of elements in each dimension. ! Padding value depends on pooling type, -inf is used for max pooling and zero padding for average pooling. ! ! Default: (0, 0, …, 0) ! ! If executing this layer on DLA, only support 2D padding, both height and width of padding must be in the range ! [0,7]. ! ! \see getPrePadding() !

Source

pub fn getPrePadding(self: &IPoolingLayer) -> Dims64

! ! \brief Get the pre-padding. ! ! \see setPrePadding() !

Source

pub fn setPostPadding(self: Pin<&mut IPoolingLayer>, padding: &Dims64)

! ! \brief Set the multi-dimension post-padding for pooling. ! ! The end of the input will be padded by this number of elements in each dimension. ! Padding value depends on pooling type, -inf is used for max pooling and zero padding for average pooling. ! ! Default: (0, 0, …, 0) ! ! If executing this layer on DLA, only support 2D padding, both height and width of padding must be in the range ! [0,7]. ! ! \see getPostPadding() !

Source

pub fn getPostPadding(self: &IPoolingLayer) -> Dims64

! ! \brief Get the padding. ! ! \see setPostPadding() !

Source

pub fn setPaddingMode(self: Pin<&mut IPoolingLayer>, paddingMode: PaddingMode)

! ! \brief Set the padding mode. ! ! Padding mode takes precedence if both setPaddingMode and setPre/PostPadding are used. ! ! Default: kEXPLICIT_ROUND_DOWN ! ! \see getPaddingMode()

Source

pub fn getPaddingMode(self: &IPoolingLayer) -> PaddingMode

! ! \brief Get the padding mode. ! ! Default: kEXPLICIT_ROUND_DOWN ! ! \see setPaddingMode()

Source

pub fn setWindowSizeNd(self: Pin<&mut IPoolingLayer>, windowSize: &Dims64)

! ! \brief Set the multi-dimension window size for pooling. ! ! If executing this layer on DLA, only support 2D window size, both height and width of window size must be in the ! range [1,8]. ! ! \see getWindowSizeNd() setWindowSize() getWindowSize() !

Source

pub fn getWindowSizeNd(self: &IPoolingLayer) -> Dims64

! ! \brief Get the multi-dimension window size for pooling. ! ! \see setWindowSizeNd() !

Source

pub fn setStrideNd(self: Pin<&mut IPoolingLayer>, stride: &Dims64)

! ! \brief Set the multi-dimension stride for pooling. ! ! Default: (1, 1, …, 1) ! ! If executing this layer on DLA, only support 2D stride, both height and width of stride must be in the range ! [1,16]. ! ! \see getStrideNd() !

Source

pub fn getStrideNd(self: &IPoolingLayer) -> Dims64

! ! \brief Get the multi-dimension stride for pooling. ! ! \see setStrideNd() !

Source

pub fn setPaddingNd(self: Pin<&mut IPoolingLayer>, padding: &Dims64)

! ! \brief Set the multi-dimension padding for pooling. ! ! The input will be padded by this number of elements in each dimension. ! Padding is symmetric. ! Padding value depends on pooling type, -inf is used for max pooling and zero padding for average pooling. ! ! Default: (0, 0, …, 0) ! ! If executing this layer on DLA, only support 2D padding, both height and width of padding must be in the range ! [0,7]. ! ! \see getPaddingNd() setPadding() getPadding() !

Source

pub fn getPaddingNd(self: &IPoolingLayer) -> Dims64

! ! \brief Get the multi-dimension padding for pooling. ! ! If the padding is asymmetric, the pre-padding is returned. ! ! \see setPaddingNd() !

Trait Implementations§

Source§

impl AsRef<ILayer> for IPoolingLayer

Source§

fn as_ref(self: &IPoolingLayer) -> &ILayer

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl ExternType for IPoolingLayer

Source§

type Id = (n, v, i, n, f, e, r, _1, (), I, P, o, o, l, i, n, g, L, a, y, e, r)

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

type Kind = Opaque

Source§

impl MakeCppStorage for IPoolingLayer

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut IPoolingLayer

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
Source§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut IPoolingLayer)

Frees a C++ allocation which has not yet had a constructor called. Read more

Auto Trait Implementations§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.