aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/ops/ewise_unary.cc
diff options
context:
space:
mode:
authorTai Ly <tai.ly@arm.com>2024-04-05 01:19:31 +0000
committerTai Ly <tai.ly@arm.com>2024-04-15 14:28:29 +0000
commit5d0e9c7f3748e80d6f14a3eeaef858eeb912e1fd (patch)
treed9dddba756207cee68b948d434502801be93d6c4 /reference_model/src/ops/ewise_unary.cc
parent6dc755bf141726a7582ad1a844f97cb3f50c9b21 (diff)
downloadreference_model-5d0e9c7f3748e80d6f14a3eeaef858eeb912e1fd.tar.gz
[ref model] fix const/pad/clamp attribute serialization
This changes to use native type serialization and deserialization for pad_const, clamp min_val/max_val and const data attribute values whereby fp16 values are stored as 2 bytes each, fp8 values are stored in 1 byte each, etc. Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: Ia95d320fe8c546ce1d1ccc035d6e9bcaadcc9ca3
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();