TensorRT 10.8.0
|
用于构建条件执行子图的辅助类。 更多...
#include <NvInfer.h>
公共成员函数 | |
IConditionLayer * | setCondition (ITensor &condition) noexcept |
为此 If-Conditional 结构设置条件张量。 更多... | |
IIfConditionalOutputLayer * | addOutput (ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept |
添加 If-conditional 输出。 更多... | |
IIfConditionalInputLayer * | addInput (ITensor &input) noexcept |
添加 If-conditional 输入。 更多... | |
void | setName (char const *name) noexcept |
设置 conditional 的名称。 更多... | |
char const * | getName () const noexcept |
返回 conditional 的名称。 更多... | |
保护成员函数 | |
virtual | ~IIfConditional () 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::VIfConditional * | mImpl |
用于构建条件执行子图的辅助类。
If-conditional 根据以下伪代码有条件地执行网络的一部分
如果 condition 为真: output = trueSubgraph(trueInputs); 否则 output = falseSubgraph(falseInputs); 发射 output
Condition 是一个 0D 布尔张量(表示标量)。 trueSubgraph 表示当 condition 评估为 True 时执行的网络子图。 falseSubgraph 表示当 condition 评估为 False 时执行的网络子图。
以下约束适用于 If-conditionals
|
protectedvirtualdefaultnoexcept |
|
inlinenoexcept |
添加 If-conditional 输入。
input | conditional 的一个输入,可以被 conditional 的子图中的一个或两个使用。 |
|
inlinenoexcept |
添加 If-conditional 输出。
trueSubgraphOutput | 当 conditional 评估为 true 时执行的子图的输出。 |
falseSubgraphOutput | 当 conditional 评估为 false 时执行的子图的输出。 |
IIfConditional 的每个输出层代表 IIfConditional 的 true-subgraph 或 false-subgraph 的单个输出,具体取决于执行哪个子图。
除非 condition 是构建时常量,否则两个张量的形状必须相等。
|
inlinenoexcept |
返回 conditional 的名称。
|
inlinenoexcept |
为此 If-Conditional 结构设置条件张量。
condition | 将确定执行哪个子图的条件张量。 |
condition
张量必须是类型为 DataType::kBOOL 的 0D 执行张量(标量)。
|
inlinenoexcept |
|
protected |
版权所有 © 2024 NVIDIA Corporation
隐私政策 | 管理我的隐私 | 请勿出售或分享我的数据 | 服务条款 | 无障碍访问 | 公司政策 | 产品安全 | 联系方式