SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
|
Conditionally forwards an input to one of two outputs. More...
#include <control_flow_ops.h>
Conditionally forwards an input to one of two outputs.
The switch operator copies an input Tensor to one of two output tensors, depending on whether the specified predicate is true. The other tensor is marked as dead.
This is an integral component of implementing control flow in networks.
Backend | The Backend specialization of this Operator. |
Public Types | |
enum | { Input, Pred, kNumInputs } |
enum | { OutputFalse, OutputTrue, kNumOutputs } |
Public Member Functions | |
SwitchOp (const std::string &name, Workspace *workspace) | |
bool | validate () override |
void | createAllTensors () override |
void | run () override |
anonymous enum |
Enumerator | |
---|---|
Input | The input Tensor to pass through. |
Pred | A scalar Tensor (a Tensor with just one value). 0 is false; anything nonzero is true. |
Definition at line 25 of file control_flow_ops.h.
anonymous enum |
Enumerator | |
---|---|
OutputFalse | The output tensor on the false branch. |
OutputTrue | The output tensor on the true branch. |
Definition at line 33 of file control_flow_ops.h.