SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
|
1 #ifndef _OPERATORS_UNARY_OP_H_
2 #define _OPERATORS_UNARY_OP_H_
6 #include "smaug/core/operator.h"
7 #include "smaug/core/workspace.h"
19 template <
typename Backend>
23 :
Operator(name, opType, workspace) {
24 inputs.resize(kNumInputs,
nullptr);
25 outputs.resize(kNumOutputs,
nullptr);
31 createOutputTensors();
34 void createOutputTensors() {
39 workspace->addTensor(output);
43 enum { Inputs, kNumInputs };
44 enum { Outputs, kNumOutputs };
Tensor represents a single multi-dimensional array of data.
Workspace is the container and owner of all Tensors and Operators in the Network.
bool validate() override
Returns true if the parameters/tensors of this operator are all valid.
TensorShape describes the shape of a Tensor.
std::vector< TensorBase * > outputs
An ordered list of output tensors produced by this operator.
void createAllTensors() override
For tests: creates all input and output tensors for this operator.
Operator is the base class for all graph operators supported by SMAUG.
The smaug namespace is the parent namespace of all C++ code in SMAUG.
virtual bool validate()
Returns true if the parameters/tensors of this operator are all valid.
Base class for all operators with one input.
std::vector< TensorBase * > inputs
An ordered list of input tensors consumed by this operator.