TensorRT 10.0.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...
 
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 const &padding) noexcept
 Set the multi-dimension pre-padding for pooling. More...
 
Dims getPrePadding () const noexcept
 Get the pre-padding. More...
 
void setPostPadding (Dims const &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 const &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 const &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 const &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 (char const *name) noexcept
 Set the name of a layer. More...
 
char const * getName () const noexcept
 Return the name of a layer. More...
 
int32_t getNbInputs () const noexcept
 Get the number of inputs of a layer. More...
 
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. More...
 
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 preferred or required computational precision of this layer in a weakly-typed network. 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 in a weakly-typed network. 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...
 
void setMetadata (char const *metadata) noexcept
 Set the metadata for this layer. More...
 
char const * getMetadata () const noexcept
 Get the metadata of the layer. More...
 

Protected Member Functions

virtual ~IPoolingLayer () noexcept=default
 
- Protected Member Functions inherited from nvinfer1::ILayer
virtual ~ILayer () noexcept=default
 
- Protected Member Functions inherited from nvinfer1::INoCopy
 INoCopy ()=default
 
virtual ~INoCopy ()=default
 
 INoCopy (INoCopy const &other)=delete
 
INoCopyoperator= (INoCopy const &other)=delete
 
 INoCopy (INoCopy &&other)=delete
 
INoCopyoperator= (INoCopy &&other)=delete
 

Protected Attributes

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

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.

Constructor & Destructor Documentation

◆ ~IPoolingLayer()

virtual nvinfer1::IPoolingLayer::~IPoolingLayer ( )
protectedvirtualdefaultnoexcept

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

◆ 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()

◆ getStrideNd()

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

Get the multi-dimension stride for pooling.

See also
setStrideNd()

◆ 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

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

◆ 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 const &  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 const &  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 const &  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()

◆ setStrideNd()

void nvinfer1::IPoolingLayer::setStrideNd ( Dims const &  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()

◆ setWindowSizeNd()

void nvinfer1::IPoolingLayer::setWindowSizeNd ( Dims const &  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()

Member Data Documentation

◆ mImpl

apiv::VPoolingLayer* nvinfer1::IPoolingLayer::mImpl
protected

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

  Copyright © 2024 NVIDIA Corporation
  Privacy Policy | Manage My Privacy | Do Not Sell or Share My Data | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact