SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
operator.cpp
1 #include "smaug/core/operator.h"
2 
3 namespace smaug {
4 
6  bool anyInputDead = false;
7  for (auto input : inputs) {
8  if (input->isDead()) {
9  anyInputDead = true;
10  break;
11  }
12  }
13  return anyInputDead;
14 }
15 
16 void Operator::printSummary(std::ostream& out) const {
17  boost::format fmter(kLayerFormat);
18  out << fmter % (this->name + " (" + OpType_Name(opType) + ")") %
19  outputs.at(0)->getShape() % getNumParameters();
20  if (outputs.size() > 1) {
21  for (int i = 1; i < outputs.size(); i++)
22  out << fmter % "" % outputs.at(i)->getShape() % "";
23  }
24 }
25 
26 } // namespace smaug
smaug::Operator::getNumParameters
virtual int getNumParameters() const
This returns the number of parameterizable weights in the operator.
Definition: operator.h:89
smaug::Operator::outputs
std::vector< TensorBase * > outputs
An ordered list of output tensors produced by this operator.
Definition: operator.h:141
smaug
The smaug namespace is the parent namespace of all C++ code in SMAUG.
Definition: backend.cpp:38
smaug::Operator::inputs
std::vector< TensorBase * > inputs
An ordered list of input tensors consumed by this operator.
Definition: operator.h:134
smaug::Operator::isDead
virtual bool isDead()
Returns true if the Operator is dead.
Definition: operator.cpp:5