aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/ops/ewise_unary.cc
diff options
context:
space:
mode:
Diffstat (limited to 'reference_model/src/ops/ewise_unary.cc')
-rw-r--r--reference_model/src/ops/ewise_unary.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/reference_model/src/ops/ewise_unary.cc b/reference_model/src/ops/ewise_unary.cc
index dd9ea5a..310a174 100644
--- a/reference_model/src/ops/ewise_unary.cc
+++ b/reference_model/src/ops/ewise_unary.cc
@@ -66,6 +66,13 @@ int UnaryNode<Rank, Dtype>::checkTensorAttributes()
template <int Rank, TOSA_REF_TYPE Dtype>
int UnaryNode<Rank, Dtype>::eval()
{
+ // call register_fcn() here to ensure inputs/outputs have been connected
+ // to the node by the time register_fcn() is called for Clamp Operator
+ if (register_fcn())
+ {
+ return 1;
+ }
+
this->result->getTensor() = this->a->getTensor().unaryExpr(this->fcn);
return GraphNode::eval();