TensorRT 10.8.0
nvinfer1::IConvolutionLayer 类参考

网络定义中的卷积层。 更多...

#include <NvInfer.h>

nvinfer1::IConvolutionLayer 的继承关系图
nvinfer1::ILayer nvinfer1::INoCopy

公共成员函数

void setNbOutputMaps (int64_t nbOutputMaps) noexcept
 设置卷积的输出特征图数量。 更多...
 
int64_t getNbOutputMaps () const noexcept
 获取卷积的输出特征图数量。 更多...
 
void setNbGroups (int64_t nbGroups) noexcept
 设置卷积的分组数量。 更多...
 
int64_t getNbGroups () const noexcept
 获取卷积的分组数量。 更多...
 
void setKernelWeights (Weights weights) noexcept
 设置卷积的内核权重。 更多...
 
Weights getKernelWeights () const noexcept
 获取卷积的内核权重。 更多...
 
void setBiasWeights (Weights weights) noexcept
 设置卷积的偏置权重。 更多...
 
Weights getBiasWeights () const noexcept
 获取卷积的偏置权重。 更多...
 
void setPrePadding (Dims const &padding) noexcept
 设置卷积的多维前填充。 更多...
 
Dims getPrePadding () const noexcept
 获取前填充。 更多...
 
void setPostPadding (Dims const &padding) noexcept
 设置卷积的多维后填充。 更多...
 
Dims getPostPadding () const noexcept
 获取后填充。 更多...
 
void setPaddingMode (PaddingMode paddingMode) noexcept
 设置填充模式。 更多...
 
PaddingMode getPaddingMode () const noexcept
 获取填充模式。 更多...
 
void setKernelSizeNd (Dims const &kernelSize) noexcept
 设置卷积的多维内核大小。 更多...
 
Dims getKernelSizeNd () const noexcept
 获取卷积的多维内核大小。 更多...
 
void setStrideNd (Dims const &stride) noexcept
 设置卷积的多维步长。 更多...
 
Dims getStrideNd () const noexcept
 获取卷积的多维步长。 更多...
 
void setPaddingNd (Dims const &padding) noexcept
 设置卷积的多维填充。 更多...
 
Dims getPaddingNd () const noexcept
 获取卷积的多维填充。 更多...
 
void setDilationNd (Dims const &dilation) noexcept
 设置卷积的多维空洞率。 更多...
 
Dims getDilationNd () const noexcept
 获取卷积的多维空洞率。 更多...
 
void setInput (int32_t index, ITensor &tensor) noexcept
 使用特定的张量追加或替换此层的输入。 更多...
 
- 继承自 nvinfer1::ILayer 的公共成员函数
LayerType getType () const noexcept
 返回层的类型。 更多...
 
void setName (char const *name) noexcept
 设置层的名称。 更多...
 
char const * getName () const noexcept
 返回层的名称。 更多...
 
int32_t getNbInputs () const noexcept
 获取层的输入数量。 更多...
 
ITensorgetInput (int32_t index) const noexcept
 获取与给定索引对应的层输入。 更多...
 
int32_t getNbOutputs () const noexcept
 获取层的输出数量。 更多...
 
ITensorgetOutput (int32_t index) const noexcept
 获取与给定索引对应的层输出。 更多...
 
void setInput (int32_t index, ITensor &tensor) noexcept
 使用特定的张量替换此层的输入。 更多...
 
void setPrecision (DataType dataType) noexcept
 在弱类型网络中,设置此层的首选或必需的计算精度。 更多...
 
DataType getPrecision () const noexcept
 获取此层的计算精度 更多...
 
bool precisionIsSet () const noexcept
 是否已为此层设置计算精度 更多...
 
void resetPrecision () noexcept
 重置此层的计算精度 更多...
 
void setOutputType (int32_t index, DataType dataType) noexcept
 在弱类型网络中,设置此层的输出类型。 更多...
 
DataType getOutputType (int32_t index) const noexcept
 获取此层的输出类型 更多...
 
bool outputTypeIsSet (int32_t index) const noexcept
 是否已为此层设置输出类型 更多...
 
void resetOutputType (int32_t index) noexcept
 重置此层的输出类型 更多...
 
void setMetadata (char const *metadata) noexcept
 为此层设置元数据。 更多...
 
char const * getMetadata () const noexcept
 获取层的元数据。 更多...
 

保护成员函数

virtual ~IConvolutionLayer () noexcept=default
 
- 继承自 nvinfer1::ILayer 的保护成员函数
virtual ~ILayer () noexcept=default
 
- 继承自 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
 

保护属性

apiv::VConvolutionLayer * mImpl
 
- 继承自 nvinfer1::ILayer 的保护属性
apiv::VLayer * mLayer
 

详细描述

网络定义中的卷积层。

此层在 3 或 4 维滤波器与 4 或 5 维张量之间执行相关运算,以生成另一个 4 或 5 维张量。

支持可选的偏置参数,它将每个通道的常数添加到输出中的每个值。

警告
请勿从此类继承,否则会破坏 API 和 ABI 的向前兼容性。

构造函数 & 析构函数文档

◆ ~IConvolutionLayer()

virtual nvinfer1::IConvolutionLayer::~IConvolutionLayer ( )
protectedvirtualdefaultnoexcept

成员函数文档

◆ getBiasWeights()

Weights nvinfer1::IConvolutionLayer::getBiasWeights ( ) const
inlinenoexcept

获取卷积的偏置权重。

另请参阅
setBiasWeights()

◆ getDilationNd()

Dims nvinfer1::IConvolutionLayer::getDilationNd ( ) const
inlinenoexcept

获取卷积的多维空洞率。

另请参阅
setDilationNd()

◆ getKernelSizeNd()

Dims nvinfer1::IConvolutionLayer::getKernelSizeNd ( ) const
inlinenoexcept

获取卷积的多维内核大小。

另请参阅
setKernelSizeNd()

◆ getKernelWeights()

Weights nvinfer1::IConvolutionLayer::getKernelWeights ( ) const
inlinenoexcept

获取卷积的内核权重。

另请参阅
setKernelWeights()

◆ getNbGroups()

int64_t nvinfer1::IConvolutionLayer::getNbGroups ( ) const
inlinenoexcept

获取卷积的分组数量。

另请参阅
setNbGroups()

◆ getNbOutputMaps()

int64_t nvinfer1::IConvolutionLayer::getNbOutputMaps ( ) const
inlinenoexcept

获取卷积的输出特征图数量。

另请参阅
setNbOutputMaps()

◆ getPaddingMode()

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

获取填充模式。

默认值:kEXPLICIT_ROUND_DOWN

另请参阅
setPaddingMode()

◆ getPaddingNd()

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

获取卷积的多维填充。

如果填充是不对称的,则返回前填充。

另请参阅
setPaddingNd()

◆ getPostPadding()

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

获取后填充。

另请参阅
setPostPadding()

◆ getPrePadding()

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

获取前填充。

另请参阅
setPrePadding()

◆ getStrideNd()

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

获取卷积的多维步长。

另请参阅
setStrideNd()

◆ setBiasWeights()

void nvinfer1::IConvolutionLayer::setBiasWeights ( Weights  weights)
inlinenoexcept

设置卷积的偏置权重。

偏置是可选的。要省略偏置,请将权重结构的计数设置为零。

偏置是按通道应用的,因此权重数(如果非零)必须等于输出特征图的数量。

另请参阅
getBiasWeights()

◆ setDilationNd()

void nvinfer1::IConvolutionLayer::setDilationNd ( Dims const &  dilation)
inlinenoexcept

设置卷积的多维空洞率。

默认值:(1, 1, ..., 1)

如果在 DLA 上执行此层,则仅支持 2D 填充,高度和宽度都必须在 [1,32] 范围内。

另请参阅
getDilationNd()

◆ setInput()

void nvinfer1::ILayer::setInput ( int32_t  index,
ITensor tensor 
)
inlinenoexcept

使用特定的张量追加或替换此层的输入。

参数
indexindex
要修改的输入的索引。tensor

新的输入张量

索引如下:

另请参阅
输入 0 是输入激活张量。输入 1 是内核张量。如果使用,则内核权重参数必须设置为空权重。输入 2 是偏置张量。如果使用,则偏置参数必须设置为空权重。

◆ setKernelSizeNd()

void nvinfer1::IConvolutionLayer::setKernelSizeNd ( Dims const &  kernelSize)
inlinenoexcept

设置卷积的多维内核大小。

如果在 DLA 上执行此层,则仅支持 2D 内核大小,内核大小的高度和宽度都必须在 [1,32] 范围内。

另请参阅
getKernelSizeNd()

◆ setKernelWeights()

void nvinfer1::IConvolutionLayer::setKernelWeights ( Weights  weights)
inlinenoexcept

设置卷积的内核权重。

权重指定为 GKCRS 顺序的连续数组,其中 G 是组数,K 是输出特征图的数量,C 是输入通道数,RS 是滤波器的高度和宽度。

另请参阅
getKernelWeights()

◆ setNbGroups()

void nvinfer1::IConvolutionLayer::setNbGroups ( int64_t  nbGroups)
inlinenoexcept

设置卷积的分组数量。

输入张量通道被分为 nbGroups 组,并且为每个组执行卷积,每个组使用一个滤波器。组卷积的结果被连接起来以形成输出。

注意
当在 int8 模式下使用组时,组的大小(即通道数除以组数)对于输入和输出都必须是 4 的倍数。

默认值:1

如果在 DLA 上执行此层,则最大组数为 8192。

另请参阅
getNbGroups()

◆ setNbOutputMaps()

void nvinfer1::IConvolutionLayer::setNbOutputMaps ( int64_t  nbOutputMaps)
inlinenoexcept

设置卷积的输出特征图数量。

如果在 DLA 上执行此层,则输出特征图的数量必须在 [1,8192] 范围内。

另请参阅
getNbOutputMaps()

◆ setPaddingMode()

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

设置填充模式。

如果同时使用 setPaddingMode 和 setPre/PostPadding,则填充模式优先。

默认值:kEXPLICIT_ROUND_DOWN

另请参阅
getPaddingMode()

◆ setPaddingNd()

void nvinfer1::IConvolutionLayer::setPaddingNd ( Dims const &  padding)
inlinenoexcept

设置卷积的多维填充。

输入将在每个维度上用此数量的元素进行零填充。填充是对称的。

默认值:(0, 0, ..., 0)

如果在 DLA 上执行此层,则仅支持 2D 填充,填充的高度和宽度都必须在 [0,31] 范围内,并且填充必须小于内核大小。

另请参阅
getPaddingNd() setPadding() getPadding()

◆ setPostPadding()

void nvinfer1::IConvolutionLayer::setPostPadding ( Dims const &  padding)
inlinenoexcept

设置卷积的多维后填充。

输入的末尾将在每个维度上用此数量的元素进行零填充。

默认值:(0, 0, ..., 0)

如果在 DLA 上执行此层,则仅支持 2D 填充,填充的高度和宽度都必须在 [0,31] 范围内,并且填充必须小于内核大小。

另请参阅
getPostPadding()

◆ setPrePadding()

void nvinfer1::IConvolutionLayer::setPrePadding ( Dims const &  padding)
inlinenoexcept

设置卷积的多维前填充。

输入的开始将在每个维度上用此数量的元素进行零填充。

默认值:(0, 0, ..., 0)

如果在 DLA 上执行此层,则仅支持 2D 填充,填充的高度和宽度都必须在 [0,31] 范围内,并且填充必须小于内核大小。

另请参阅
getPrePadding()

◆ setStrideNd()

void nvinfer1::IConvolutionLayer::setStrideNd ( Dims const &  stride)
inlinenoexcept

设置卷积的多维步长。

默认值:(1, 1, ..., 1)

如果在 DLA 上执行此层,则仅支持 2D 步长,步长的高度和宽度都必须在 [1,8] 范围内。

另请参阅
getStrideNd()

成员数据文档

◆ mImpl

apiv::VConvolutionLayer* nvinfer1::IConvolutionLayer::mImpl
protected

此类文档从以下文件生成:

  版权所有 © 2024 NVIDIA Corporation
  隐私政策 | 管理我的隐私 | 请勿出售或分享我的数据 | 服务条款 | 辅助功能 | 公司政策 | 产品安全 | 联系我们