TensorRT 8.2.5
|
#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 (const char *name) noexcept |
Set the name of the conditional. More... | |
const char * | getName () const noexcept |
Return the name of the conditional. More... | |
Protected Attributes | |
apiv::VIfConditional * | mImpl |
Additional Inherited Members | |
![]() | |
INoCopy (const INoCopy &other)=delete | |
INoCopy & | operator= (const INoCopy &other)=delete |
INoCopy (INoCopy &&other)=delete | |
INoCopy & | operator= (INoCopy &&other)=delete |
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:
|
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 data 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.
Copyright © 2024 NVIDIA Corporation
Privacy Policy |
Manage My Privacy |
Do Not Sell or Share My Data |
Terms of Service |
Accessibility |
Corporate Policies |
Product Security |
Contact