TensorRT 8.2.1
nvinfer1::IPoolingLayer Class Reference

A Pooling layer in a network definition. More...

#include <NvInfer.h>

Inheritance diagram for nvinfer1::IPoolingLayer:
nvinfer1::ILayer nvinfer1::INoCopy

Public Member Functions

void setPoolingType (PoolingType type) noexcept
 Set the type of activation to be performed. More...
 
PoolingType getPoolingType () const noexcept
 Get the type of activation to be performed. More...
 
TRT_DEPRECATED void setWindowSize (DimsHW windowSize) noexcept
 Set the window size for pooling. More...
 
TRT_DEPRECATED DimsHW getWindowSize () const noexcept
 Get the window size for pooling. More...
 
TRT_DEPRECATED void setStride (DimsHW stride) noexcept
 Set the stride for pooling. More...
 
TRT_DEPRECATED DimsHW getStride () const noexcept
 Get the stride for pooling. More...
 
TRT_DEPRECATED void setPadding (DimsHW padding) noexcept
 Set the padding for pooling. More...
 
TRT_DEPRECATED DimsHW getPadding () const noexcept
 Get the padding for pooling. More...
 
void setBlendFactor (float blendFactor) noexcept
 Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPool + blendFactor*avgPool 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. More...
 
float getBlendFactor () const noexcept
 Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPool + blendFactor*avgPool 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. More...
 
void setAverageCountExcludesPadding (bool exclusive) noexcept
 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. More...
 
bool getAverageCountExcludesPadding () const noexcept
 Get whether average pooling uses as a denominator the overlap area between the window and the unpadded input. More...
 
void setPrePadding (Dims padding) noexcept
 Set the multi-dimension pre-padding for pooling. More...
 
Dims getPrePadding () const noexcept
 Get the pre-padding. More...
 
void setPostPadding (Dims padding) noexcept
 Set the multi-dimension post-padding for pooling. More...
 
Dims getPostPadding () const noexcept
 Get the padding. More...
 
void setPaddingMode (PaddingMode paddingMode) noexcept
 Set the padding mode. More...
 
PaddingMode getPaddingMode () const noexcept
 Get the padding mode. More...
 
void setWindowSizeNd (Dims windowSize) noexcept
 Set the multi-dimension window size for pooling. More...
 
Dims getWindowSizeNd () const noexcept
 Get the multi-dimension window size for pooling. More...
 
void setStrideNd (Dims stride) noexcept
 Set the multi-dimension stride for pooling. More...
 
Dims getStrideNd () const noexcept
 Get the multi-dimension stride for pooling. More...
 
void setPaddingNd (Dims padding) noexcept
 Set the multi-dimension padding for pooling. More...
 
Dims getPaddingNd () const noexcept
 Get the multi-dimension padding for pooling. More...
 
- Public Member Functions inherited from nvinfer1::ILayer
LayerType getType () const noexcept
 Return the type of a layer. More...
 
void setName (const char *name) noexcept
 Set the name of a layer. More...
 
const char * getName () const noexcept
 Return the name of a layer. More...
 
int32_t getNbInputs () const noexcept
 Get the number of inputs of a layer.
 
ITensorgetInput (int32_t index) const noexcept
 Get the layer input corresponding to the given index. More...
 
int32_t getNbOutputs () const noexcept
 Get the number of outputs of a layer.
 
ITensorgetOutput (int32_t index) const noexcept
 Get the layer output corresponding to the given index. More...
 
void setInput (int32_t index, ITensor &tensor) noexcept
 Replace an input of this layer with a specific tensor. More...
 
void setPrecision (DataType dataType) noexcept
 Set the computational precision of this layer. More...
 
DataType getPrecision () const noexcept
 get the computational precision of this layer More...
 
bool precisionIsSet () const noexcept
 whether the computational precision has been set for this layer More...
 
void resetPrecision () noexcept
 reset the computational precision for this layer More...
 
void setOutputType (int32_t index, DataType dataType) noexcept
 Set the output type of this layer. More...
 
DataType getOutputType (int32_t index) const noexcept
 get the output type of this layer More...
 
bool outputTypeIsSet (int32_t index) const noexcept
 whether the output type has been set for this layer More...
 
void resetOutputType (int32_t index) noexcept
 reset the output type for this layer More...
 

Protected Attributes

apiv::VPoolingLayer * mImpl
 
- Protected Attributes inherited from nvinfer1::ILayer
apiv::VLayer * mLayer
 

Additional Inherited Members

- Protected Member Functions inherited from nvinfer1::INoCopy
 INoCopy (const INoCopy &other)=delete
 
INoCopyoperator= (const INoCopy &other)=delete
 
 INoCopy (INoCopy &&other)=delete
 
INoCopyoperator= (INoCopy &&other)=delete
 

Detailed Description

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.
Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.

Member Function Documentation

◆ getAverageCountExcludesPadding()

bool nvinfer1::IPoolingLayer::getAverageCountExcludesPadding ( ) const
inlinenoexcept

Get whether average pooling uses as a denominator the overlap area between the window and the unpadded input.

See also
setAverageCountExcludesPadding()

◆ getBlendFactor()

float nvinfer1::IPoolingLayer::getBlendFactor ( ) const
inlinenoexcept

Get the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPool + blendFactor*avgPool 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 also
setBlendFactor()

◆ getPadding()

TRT_DEPRECATED DimsHW nvinfer1::IPoolingLayer::getPadding ( ) const
inlinenoexcept

Get the padding for pooling.

Default: 0

See also
setPadding()
Deprecated:
Superseded by getPaddingNd and will be removed in TensorRT 9.0.

◆ getPaddingMode()

PaddingMode nvinfer1::IPoolingLayer::getPaddingMode ( ) const
inlinenoexcept

Get the padding mode.

Default: kEXPLICIT_ROUND_DOWN

See also
setPaddingMode()

◆ getPaddingNd()

Dims nvinfer1::IPoolingLayer::getPaddingNd ( ) const
inlinenoexcept

Get the multi-dimension padding for pooling.

If the padding is asymmetric, the pre-padding is returned.

See also
setPaddingNd()

◆ getPoolingType()

PoolingType nvinfer1::IPoolingLayer::getPoolingType ( ) const
inlinenoexcept

Get the type of activation to be performed.

See also
setPoolingType(), PoolingType

◆ getPostPadding()

Dims nvinfer1::IPoolingLayer::getPostPadding ( ) const
inlinenoexcept

Get the padding.

See also
setPostPadding()

◆ getPrePadding()

Dims nvinfer1::IPoolingLayer::getPrePadding ( ) const
inlinenoexcept

Get the pre-padding.

See also
setPrePadding()

◆ getStride()

TRT_DEPRECATED DimsHW nvinfer1::IPoolingLayer::getStride ( ) const
inlinenoexcept

Get the stride for pooling.

See also
setStride()
Deprecated:
Superseded by getStrideNd and will be removed in TensorRT 9.0.

◆ getStrideNd()

Dims nvinfer1::IPoolingLayer::getStrideNd ( ) const
inlinenoexcept

Get the multi-dimension stride for pooling.

See also
setStrideNd()

◆ getWindowSize()

TRT_DEPRECATED DimsHW nvinfer1::IPoolingLayer::getWindowSize ( ) const
inlinenoexcept

Get the window size for pooling.

See also
setWindowSize()
Deprecated:
Superseded by getWindowSizeNd and will be removed in TensorRT 9.0.

◆ getWindowSizeNd()

Dims nvinfer1::IPoolingLayer::getWindowSizeNd ( ) const
inlinenoexcept

Get the multi-dimension window size for pooling.

See also
setWindowSizeNd()

◆ setAverageCountExcludesPadding()

void nvinfer1::IPoolingLayer::setAverageCountExcludesPadding ( bool  exclusive)
inlinenoexcept

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

Note
DLA supports only inclusive padding, and thus when executing this layer on DLA, this must be explicitly set to false.
See also
getAverageCountExcludesPadding()

◆ setBlendFactor()

void nvinfer1::IPoolingLayer::setBlendFactor ( float  blendFactor)
inlinenoexcept

Set the blending factor for the max_average_blend mode: max_average_blendPool = (1-blendFactor)*maxPool + blendFactor*avgPool 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 also
getBlendFactor()

◆ setPadding()

TRT_DEPRECATED void nvinfer1::IPoolingLayer::setPadding ( DimsHW  padding)
inlinenoexcept

Set the padding for pooling.

Default: 0

If executing this layer on DLA, both height and width of padding must be in the range [0,7].

See also
getPadding()
Deprecated:
Superseded by setPaddingNd and will be removed in TensorRT 9.0.

◆ setPaddingMode()

void nvinfer1::IPoolingLayer::setPaddingMode ( PaddingMode  paddingMode)
inlinenoexcept

Set the padding mode.

Padding mode takes precedence if both setPaddingMode and setPre/PostPadding are used.

Default: kEXPLICIT_ROUND_DOWN

See also
getPaddingMode()

◆ setPaddingNd()

void nvinfer1::IPoolingLayer::setPaddingNd ( Dims  padding)
inlinenoexcept

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 also
getPaddingNd() setPadding() getPadding()

◆ setPoolingType()

void nvinfer1::IPoolingLayer::setPoolingType ( PoolingType  type)
inlinenoexcept

Set the type of activation to be performed.

DLA only supports kMAX and kAVERAGE pooling types.

See also
getPoolingType(), PoolingType

◆ setPostPadding()

void nvinfer1::IPoolingLayer::setPostPadding ( Dims  padding)
inlinenoexcept

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 also
getPostPadding()

◆ setPrePadding()

void nvinfer1::IPoolingLayer::setPrePadding ( Dims  padding)
inlinenoexcept

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 also
getPrePadding()

◆ setStride()

TRT_DEPRECATED void nvinfer1::IPoolingLayer::setStride ( DimsHW  stride)
inlinenoexcept

Set the stride for pooling.

Default: 1

If executing this layer on DLA, both height and width of stride must be in the range [1,16].

See also
getStride()
Deprecated:
Superseded by setStrideNd and will be removed in TensorRT 9.0.

◆ setStrideNd()

void nvinfer1::IPoolingLayer::setStrideNd ( Dims  stride)
inlinenoexcept

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 also
getStrideNd() setStride() getStride()

◆ setWindowSize()

TRT_DEPRECATED void nvinfer1::IPoolingLayer::setWindowSize ( DimsHW  windowSize)
inlinenoexcept

Set the window size for pooling.

If executing this layer on DLA, both height and width of window size must be in the range [1,8].

See also
getWindowSize()
Deprecated:
Superseded by setWindowSizeNd and will be removed in TensorRT 9.0.

◆ setWindowSizeNd()

void nvinfer1::IPoolingLayer::setWindowSizeNd ( Dims  windowSize)
inlinenoexcept

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 also
getWindowSizeNd() setWindowSize() getWindowSize()

The documentation for this class was generated from the following file: