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
impl IPoolingLayer
Sourcepub fn setPoolingType(self: Pin<&mut IPoolingLayer>, type_: PoolingType)
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 !
Sourcepub fn getPoolingType(self: &IPoolingLayer) -> PoolingType
pub fn getPoolingType(self: &IPoolingLayer) -> PoolingType
! ! \brief Get the type of activation to be performed. ! ! \see setPoolingType(), PoolingType !
Sourcepub fn setBlendFactor(self: Pin<&mut IPoolingLayer>, blendFactor: f32)
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() !
Sourcepub fn getBlendFactor(self: &IPoolingLayer) -> f32
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() !
Sourcepub fn setAverageCountExcludesPadding(
self: Pin<&mut IPoolingLayer>,
exclusive: bool,
)
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() !
Sourcepub fn getAverageCountExcludesPadding(self: &IPoolingLayer) -> bool
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() !
Sourcepub fn setPrePadding(self: Pin<&mut IPoolingLayer>, padding: &Dims64)
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() !
Sourcepub fn getPrePadding(self: &IPoolingLayer) -> Dims64
pub fn getPrePadding(self: &IPoolingLayer) -> Dims64
! ! \brief Get the pre-padding. ! ! \see setPrePadding() !
Sourcepub fn setPostPadding(self: Pin<&mut IPoolingLayer>, padding: &Dims64)
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() !
Sourcepub fn getPostPadding(self: &IPoolingLayer) -> Dims64
pub fn getPostPadding(self: &IPoolingLayer) -> Dims64
! ! \brief Get the padding. ! ! \see setPostPadding() !
Sourcepub fn setPaddingMode(self: Pin<&mut IPoolingLayer>, paddingMode: PaddingMode)
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()
Sourcepub fn getPaddingMode(self: &IPoolingLayer) -> PaddingMode
pub fn getPaddingMode(self: &IPoolingLayer) -> PaddingMode
! ! \brief Get the padding mode. ! ! Default: kEXPLICIT_ROUND_DOWN ! ! \see setPaddingMode()
Sourcepub fn setWindowSizeNd(self: Pin<&mut IPoolingLayer>, windowSize: &Dims64)
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() !
Sourcepub fn getWindowSizeNd(self: &IPoolingLayer) -> Dims64
pub fn getWindowSizeNd(self: &IPoolingLayer) -> Dims64
! ! \brief Get the multi-dimension window size for pooling. ! ! \see setWindowSizeNd() !
Sourcepub fn setStrideNd(self: Pin<&mut IPoolingLayer>, stride: &Dims64)
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() !
Sourcepub fn getStrideNd(self: &IPoolingLayer) -> Dims64
pub fn getStrideNd(self: &IPoolingLayer) -> Dims64
! ! \brief Get the multi-dimension stride for pooling. ! ! \see setStrideNd() !
Sourcepub fn setPaddingNd(self: Pin<&mut IPoolingLayer>, padding: &Dims64)
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() !
Sourcepub fn getPaddingNd(self: &IPoolingLayer) -> Dims64
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() !