TensorRT 8.6.0
|
#include <NvInfer.h>
Public Member Functions | |
IConditionLayer * | setCondition (ITensor &condition) noexcept |
Set the condition tensor for this If-Conditional construct. More... | |
IIfConditionalOutputLayer * | addOutput (ITensor &trueSubgraphOutput, ITensor &falseSubgraphOutput) noexcept |
Add an If-conditional output. More... | |
IIfConditionalInputLayer * | addInput (ITensor &input) noexcept |
Add an If-conditional input. More... | |
void | setName (char const *name) noexcept |
Set the name of the conditional. More... | |
char const * | getName () const noexcept |
Return the name of the conditional. More... | |
Protected Member Functions | |
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 |
Protected Attributes | |
apiv::VIfConditional * | mImpl |
Helper for constructing conditionally-executed subgraphs.
An If-conditional conditionally executes part of the network according to the following pseudo-code:
If condition is true then: output = trueSubgraph(trueInputs); Else output = falseSubgraph(falseInputs); Emit output
Condition is a 0D boolean tensor (representing a scalar). trueSubgraph represents a network subgraph that is executed when condition is evaluated to True. falseSubgraph represents a network subgraph that is executed when condition is evaluated to False.
The following constraints apply to If-conditionals:
|
protectedvirtualdefaultnoexcept |
|
inlinenoexcept |
Add an If-conditional input.
input | An input to the conditional that can be used by either or both of the conditional’s subgraphs. |
|
inlinenoexcept |
Add an If-conditional output.
trueSubgraphOutput | The output of the subgraph executed when the conditional evaluates to true. |
falseSubgraphOutput | The output of the subgraph executed when the conditional evaluates to false. |
Each output layer of an IIfConditional represents a single output of either the true-subgraph or the false-subgraph of an IIfConditional, depending on which subgraph was executed.
|
inlinenoexcept |
Return the name of the conditional.
|
inlinenoexcept |
Set the condition tensor for this If-Conditional construct.
condition | The condition tensor that will determine which subgraph to execute. |
condition
tensor must be a 0D execution tensor (scalar) with type DataType::kBOOL.
|
inlinenoexcept |
Set the name of the conditional.
The name is used in error diagnostics. This method copies the name string.
|
protected |