|
Poplar and PopLibs
|
A program that runs one of two programs depending on the value of a scalar tensor. More...
#include <Program.hpp>
Public Member Functions | |
| If (Tensor predicate, const Program &trueBody, const Program &falseBody, const DebugContext &debugContext={}) | |
A program that executes trueBody or falseBody depending on the value of predicate. More... | |
A program that runs one of two programs depending on the value of a scalar tensor.
| poplar::program::If::If | ( | Tensor | predicate, |
| const Program & | trueBody, | ||
| const Program & | falseBody, | ||
| const DebugContext & | debugContext = {} |
||
| ) |
A program that executes trueBody or falseBody depending on the value of predicate.
You can pass an empty Sequence to either trueBody or falseBody if you don't want that branch to do anything. Any non-zero value of the predicate is treated as true.
| predicate | The scalar tensor (of type BOOL, UNSIGNED_INT, INT, SHORT or UNSIGNED_SHORT) that determines which branch to execute. |
| trueBody | This program is run if the predicate is true. |
| falseBody | This program is run if the predicate is false. |
| debugContext | Optional DebugId and program name. |