diff options
author | Jerry Ge <jerry.ge@arm.com> | 2022-11-16 10:41:55 -0800 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2022-12-09 15:53:29 +0000 |
commit | a68274931b24625f5576ca9ee9d4268cd80fc7c8 (patch) | |
tree | 4f5b18eb703a9a5ab9462890df04b0117ce1f491 /reference_model/src/ops/ewise_binary.cc | |
parent | 4160186b6ef5f0f9e34390b0a3bb1359e9266902 (diff) | |
download | reference_model-a68274931b24625f5576ca9ee9d4268cd80fc7c8.tar.gz |
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
Diffstat (limited to 'reference_model/src/ops/ewise_binary.cc')
-rw-r--r-- | reference_model/src/ops/ewise_binary.cc | 16 |
1 files changed, 15 insertions, 1 deletions
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 @@ int OpArithmeticRightShift<Rank, Dtype>::register_fcn() } 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 @@ int OpMul<Rank, InDtype, OutDtype>::register_fcn() 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 @@ OpTable<Rank, InDtype>::OpTable(SubgraphTraverser* sgt_, template <int Rank, DType InDtype> OpTable<Rank, InDtype>::~OpTable() -{} +{ + if (attribute) delete attribute; +} template <int Rank, DType InDtype> int OpTable<Rank, InDtype>::checkTensorAttributes() |