Fix reference model memory leaks for the following ops
- OpClamp
- OpArithmeticRightShift
- OpMul
- OpTable
- OpTranspose
Signed-off-by: Jerry Ge <jerry.ge@arm.com>
Change-Id: Icb84a8a17c298b471a635310454775977a9133cb
diff --git a/reference_model/src/ops/ewise_binary.cc b/reference_model/src/ops/ewise_binary.cc
index e4c0ee0..7d0c434 100644
--- a/reference_model/src/ops/ewise_binary.cc
+++ b/reference_model/src/ops/ewise_binary.cc
@@ -192,6 +192,12 @@
}
template <int Rank, DType Dtype>
+OpArithmeticRightShift<Rank, Dtype>::~OpArithmeticRightShift()
+{
+ if (attribute) delete attribute;
+}
+
+template <int Rank, DType Dtype>
int OpBitwiseAnd<Rank, Dtype>::register_fcn()
{
switch (Dtype)
@@ -455,6 +461,12 @@
return 0;
}
+template <int Rank, DType InDtype, DType OutDtype>
+OpMul<Rank, InDtype, OutDtype>::~OpMul()
+{
+ if (attribute) delete attribute;
+}
+
template <int Rank, DType Dtype>
int OpPow<Rank, Dtype>::register_fcn()
{
@@ -512,7 +524,9 @@
template <int Rank, DType InDtype>
OpTable<Rank, InDtype>::~OpTable()
-{}
+{
+ if (attribute) delete attribute;
+}
template <int Rank, DType InDtype>
int OpTable<Rank, InDtype>::checkTensorAttributes()