pub struct IPoolingLayer { /* private fields */ }Expand description
IPoolingLayer
A Pooling layer in a network definition.
The layer applies a reduction operation within a window over the input.
When running pooling layer with DeviceType::kDLA in Int8 mode, the dynamic ranges for input and output tensors must be equal.
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)
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
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)
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
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, )
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
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)
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
Get the pre-padding.
See [setPrePadding()]
Sourcepub fn setPostPadding(self: Pin<&mut IPoolingLayer>, padding: &Dims64)
pub fn setPostPadding(self: Pin<&mut IPoolingLayer>, padding: &Dims64)
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
Get the padding.
See [setPostPadding()]
Sourcepub fn setPaddingMode(self: Pin<&mut IPoolingLayer>, paddingMode: PaddingMode)
pub fn setPaddingMode(self: Pin<&mut IPoolingLayer>, paddingMode: PaddingMode)
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
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)
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
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)
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
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)
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
Get the multi-dimension padding for pooling.
If the padding is asymmetric, the pre-padding is returned.
See [setPaddingNd()]