TensorRT 10.8.0
nvinfer1::ILoopOutputLayer 类参考

ILoopOutputLayer 是从循环获取输出的唯一方法。 更多...

#include <NvInfer.h>

nvinfer1::ILoopOutputLayer 的继承关系图
nvinfer1::ILoopBoundaryLayer nvinfer1::ILayer nvinfer1::INoCopy

公共成员函数

LoopOutput getLoopOutput () const noexcept
 获取循环输出的类型。 更多...
 
void setAxis (int32_t axis) noexcept
 设置插入连接轴的位置。如果 getLoopOutput() 为 kLAST_VALUE,则忽略此设置。 更多...
 
int32_t getAxis () const noexcept
 获取正在连接的轴。 更多...
 
void setInput (int32_t index, ITensor &tensor) noexcept
 为此层的输入追加或替换特定的张量。 更多...
 
- 继承自 nvinfer1::ILoopBoundaryLayer 的公共成员函数
ILoopgetLoop () const noexcept
 获取指向与此边界层关联的 ILoop 的指针。 更多...
 
- 继承自 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 ~ILoopOutputLayer () noexcept=default
 
- 继承自 nvinfer1::ILoopBoundaryLayer 的受保护成员函数
virtual ~ILoopBoundaryLayer () 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::VLoopOutputLayer * mImpl
 
- 继承自 nvinfer1::ILoopBoundaryLayer 的受保护属性
apiv::VLoopBoundaryLayer * mBoundary
 
- 继承自 nvinfer1::ILayer 的受保护属性
apiv::VLayer * mLayer
 

详细描述

ILoopOutputLayer 是从循环获取输出的唯一方法。

第一个输入张量必须在循环内定义;输出张量在循环外。第二个输入张量(如果存在)必须在循环外定义。

如果 getLoopOutput() 为 kLAST_VALUE,则必须提供单个输入,并且该输入必须来自同一循环中的 IRecurrenceLayer

如果 getLoopOutput() 为 kCONCATENATE 或 kREVERSE,则必须提供第二个输入。第二个输入必须是 0D 形状张量,在循环开始之前定义,用于指定输出的连接长度。

输出张量比输入张量多 j 个维度,其中如果 getLoopOutput() 为 kLAST_VALUE,则 j == 0;如果 getLoopOutput() 为 kCONCATENATE 或 kREVERSE,则 j == 1。

构造函数 & 析构函数文档

◆ ~ILoopOutputLayer()

virtual nvinfer1::ILoopOutputLayer::~ILoopOutputLayer ( )
protectedvirtualdefaultnoexcept

成员函数文档

◆ getAxis()

int32_t nvinfer1::ILoopOutputLayer::getAxis ( ) const
inlinenoexcept

获取正在连接的轴。

◆ getLoopOutput()

LoopOutput nvinfer1::ILoopOutputLayer::getLoopOutput ( ) const
inlinenoexcept

获取循环输出的类型。

◆ setAxis()

void nvinfer1::ILoopOutputLayer::setAxis ( int32_t  axis)
inlinenoexcept

设置插入连接轴的位置。如果 getLoopOutput() 为 kLAST_VALUE,则忽略此设置。

例如,如果输入张量的维度为 [b,c,d],并且 getLoopOutput() 为 kCONCATENATE,则输出具有四个维度。设 a 为第二个输入的值。 setAxis(0) 使输出具有维度 [a,b,c,d]。 setAxis(1) 使输出具有维度 [b,a,c,d]。 setAxis(2) 使输出具有维度 [b,c,a,d]。 setAxis(3) 使输出具有维度 [b,c,d,a]。 默认轴为 0。

◆ setInput()

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

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

参数
index要修改的输入的索引。
tensor新的输入张量。为给定的索引设置输入张量。对于 kLAST_VALUE 循环输出层,索引必须为 0。通过使用索引 1 调用 setInput,循环输出层将转换为 kCONCATENATE 或 kREVERSE 循环输出层。 kCONCATENATE 或 kREVERSE 循环输出层无法转换回 kLAST_VALUE 循环输出层。

对于 kCONCATENATE 或 kREVERSE 循环输出层,值 0 和 1 有效。 kCONCATENATE 或 kREVERSE 情况下的索引如下:

  • 0:对输出张量的贡献。贡献必须来自循环内部。
  • 1:连接长度标量值,必须来自循环外部,作为 Int32 或 Int64 类型的 0D 形状张量。

如果使用值 1 调用此函数,则函数 getNbInputs() 的返回值将从 1 变为 2。

成员数据文档

◆ mImpl

apiv::VLoopOutputLayer* nvinfer1::ILoopOutputLayer::mImpl
protected

此类文档生成自以下文件

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