SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
Public Types | Public Member Functions | List of all members
smaug::SwitchOp< Backend > Class Template Reference

Conditionally forwards an input to one of two outputs. More...

#include <control_flow_ops.h>

Detailed Description

template<typename Backend>
class smaug::SwitchOp< Backend >

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.

Template Parameters
BackendThe Backend specialization of this Operator.

Definition at line 53 of file backend.h.

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
 

Member Enumeration Documentation

◆ anonymous enum

template<typename Backend >
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

template<typename Backend >
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.


The documentation for this class was generated from the following files: