TensorRT 10.8.0
nvinfer1::ICumulativeLayer 类参考

表示张量上的累积操作的层。 更多...

#include <NvInfer.h>

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

公共成员函数

bool setOperation (CumulativeOperation op) noexcept
 设置层的累积操作。 更多...
 
CumulativeOperation getOperation () const noexcept
 获取层的累积操作。 更多...
 
void setExclusive (bool exclusive) noexcept
 设置是否为互斥累积或包含累积。 更多...
 
bool getExclusive () const noexcept
 获取是否为互斥累积或包含累积。 更多...
 
void setReverse (bool reverse) noexcept
 指定累积操作是否应向后应用。 更多...
 
bool getReverse () const 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 ~ICumulativeLayer () 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::VCumulativeLayer * mImpl
 
- 从 nvinfer1::ILayer 继承的保护属性
apiv::VLayer * mLayer
 

详细描述

表示张量上的累积操作的层。

它计算张量轴上的连续归约。输出始终具有与输入相同的形状。

如果归约操作是求和,则这也称为前缀和或累积和。

该操作具有前向与反向变体,以及包含与互斥变体。

例如,假设输入是长度为 n 的向量 x,输出是向量 y。那么 y[j] = sum(x[...]),其中 ... 表示此表中的一系列索引

      | forward   | reverse

-------—|--------—| ------— 包含 | 0..j | j..n-1 互斥 | 0..j-1 | j+1..n-1

对于多维张量,归约应用于指定的轴。例如,给定一个 2D 输入,轴 0 上的前向包含累积操作会在每列中生成累积和。

警告
不要从此类继承,因为这样做会破坏 API 和 ABI 的向前兼容性。

构造函数 & 析构函数文档

◆ ~ICumulativeLayer()

virtual nvinfer1::ICumulativeLayer::~ICumulativeLayer ( )
protectedvirtualdefaultnoexcept

成员函数文档

◆ getExclusive()

bool nvinfer1::ICumulativeLayer::getExclusive ( ) const
inlinenoexcept

获取是否为互斥累积或包含累积。

返回值
操作是否将排除当前索引处的元素
另请参阅
setExclusive

◆ getOperation()

CumulativeOperation nvinfer1::ICumulativeLayer::getOperation ( ) const
inlinenoexcept

获取层的累积操作。

返回值
要执行的归约操作
另请参阅
setOperation(), CumulativeOperation

◆ getReverse()"

bool nvinfer1::ICumulativeLayer::getReverse ( ) const
inlinenoexcept

获取布尔值,该值指定累积操作是否应向后应用。

返回值
累积是否将从最后一个元素开始反向运行
另请参阅
setReverse

◆ setExclusive()"

void nvinfer1::ICumulativeLayer::setExclusive ( bool  exclusive)
inlinenoexcept

设置是否为互斥累积或包含累积。

参数
exclusive操作是否将排除当前索引处的元素
另请参阅
getExclusive

◆ setOperation()"

bool nvinfer1::ICumulativeLayer::setOperation ( CumulativeOperation  op)
inlinenoexcept

设置层的累积操作。

参数
op要执行的归约操作
返回值
op 是否有效以及操作是否成功设置
另请参阅
getOperation(), CumulativeOperation

◆ setReverse()"

void nvinfer1::ICumulativeLayer::setReverse ( bool  reverse)
inlinenoexcept

指定累积操作是否应向后应用。

参数
reverse累积是否将从最后一个元素开始反向运行
另请参阅
getReverse

成员数据文档

◆ mImpl

apiv::VCumulativeLayer* nvinfer1::ICumulativeLayer::mImpl
protected

此类文档从以下文件生成

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