TensorRT 10.8.0
|
ILoopOutputLayer 是从循环获取输出的唯一方法。 更多...
#include <NvInfer.h>
公共成员函数 | |
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 |
为此层的输入追加或替换特定的张量。 更多... | |
![]() | |
ILoop * | getLoop () const noexcept |
获取指向与此边界层关联的 ILoop 的指针。 更多... | |
![]() | |
LayerType | getType () const noexcept |
返回层的类型。 更多... | |
void | setName (char const *name) noexcept |
设置层的名称。 更多... | |
char const * | getName () const noexcept |
返回层的名称。 更多... | |
int32_t | getNbInputs () const noexcept |
获取层的输入数量。 更多... | |
ITensor * | getInput (int32_t index) const noexcept |
获取与给定索引对应的层输入。 更多... | |
int32_t | getNbOutputs () const noexcept |
获取层的输出数量。 更多... | |
ITensor * | getOutput (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 |
![]() | |
virtual | ~ILoopBoundaryLayer () noexcept=default |
![]() | |
virtual | ~ILayer () noexcept=default |
![]() | |
INoCopy ()=default | |
virtual | ~INoCopy ()=default |
INoCopy (INoCopy const &other)=delete | |
INoCopy & | operator= (INoCopy const &other)=delete |
INoCopy (INoCopy &&other)=delete | |
INoCopy & | operator= (INoCopy &&other)=delete |
受保护属性 | |
apiv::VLoopOutputLayer * | mImpl |
![]() | |
apiv::VLoopBoundaryLayer * | mBoundary |
![]() | |
apiv::VLayer * | mLayer |
ILoopOutputLayer 是从循环获取输出的唯一方法。
第一个输入张量必须在循环内定义;输出张量在循环外。第二个输入张量(如果存在)必须在循环外定义。
如果 getLoopOutput() 为 kLAST_VALUE,则必须提供单个输入,并且该输入必须来自同一循环中的 IRecurrenceLayer。
如果 getLoopOutput() 为 kCONCATENATE 或 kREVERSE,则必须提供第二个输入。第二个输入必须是 0D 形状张量,在循环开始之前定义,用于指定输出的连接长度。
输出张量比输入张量多 j 个维度,其中如果 getLoopOutput() 为 kLAST_VALUE,则 j == 0;如果 getLoopOutput() 为 kCONCATENATE 或 kREVERSE,则 j == 1。
|
protectedvirtualdefaultnoexcept |
|
inlinenoexcept |
获取正在连接的轴。
|
inlinenoexcept |
获取循环输出的类型。
|
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。
|
inlinenoexcept |
为此层的输入追加或替换特定的张量。
index | 要修改的输入的索引。 |
tensor | 新的输入张量。为给定的索引设置输入张量。对于 kLAST_VALUE 循环输出层,索引必须为 0。通过使用索引 1 调用 setInput,循环输出层将转换为 kCONCATENATE 或 kREVERSE 循环输出层。 kCONCATENATE 或 kREVERSE 循环输出层无法转换回 kLAST_VALUE 循环输出层。 |
对于 kCONCATENATE 或 kREVERSE 循环输出层,值 0 和 1 有效。 kCONCATENATE 或 kREVERSE 情况下的索引如下:
如果使用值 1 调用此函数,则函数 getNbInputs() 的返回值将从 1 变为 2。
|
protected |
版权所有 © 2024 NVIDIA Corporation
隐私政策 | 管理我的隐私 | 请勿出售或分享我的数据 | 服务条款 | 无障碍功能 | 公司政策 | 产品安全 | 联系方式