| TensorRT 10.12.0
    | 
Helper for constructing conditionally-executed subgraphs. More...
#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 | 
|  Protected Member Functions inherited from nvinfer1::INoCopy | |
| 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 evaluates to True. falseSubgraph represents a network subgraph that is executed when condition evaluates to False.
The following constraints apply to If-conditionals:
The subgraphs may directly use tensors defined outside of the IIfConditional.
| 
 | 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.
The ranks of the two tensors must be equal unless the condition is a build-time constant.
| 
 | 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 | 
   
  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