aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/ops/data_layout.h
diff options
context:
space:
mode:
authorWon Jeon <won.jeon@arm.com>2023-08-10 10:33:01 +0000
committerWon Jeon <won.jeon@arm.com>2023-08-18 15:21:15 -0700
commita21b2e88d19d8cb11a9120d40bacbb594d600565 (patch)
tree3bc8a40db72a31c1e552a3bd6339627a1175686e /reference_model/src/ops/data_layout.h
parente0247481eb1f83f6eb7161d3f7ac2690b180952a (diff)
downloadreference_model-a21b2e88d19d8cb11a9120d40bacbb594d600565.tar.gz
Add DIM operator to reference model
Signed-off-by: Won Jeon <won.jeon@arm.com> Change-Id: Iea11ee5d3d98773e9c5e9b827593c05afb41ce3b
Diffstat (limited to 'reference_model/src/ops/data_layout.h')
-rw-r--r--reference_model/src/ops/data_layout.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/reference_model/src/ops/data_layout.h b/reference_model/src/ops/data_layout.h
index 94ce248..024f9a2 100644
--- a/reference_model/src/ops/data_layout.h
+++ b/reference_model/src/ops/data_layout.h
@@ -66,6 +66,27 @@ protected:
TosaPadAttribute* attribute;
};
+template <int Rank, TOSA_REF_TYPE Dtype>
+class OpDim : public GraphNode
+{
+public:
+ OpDim(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_);
+ virtual ~OpDim();
+
+ virtual int checkTensorAttributes();
+ virtual int eval();
+
+ using InEigenType = typename GetEigenType<Dtype>::type;
+ using OutEigenType = typename GetEigenType<TOSA_REF_TYPE_SHAPE>::type;
+ using TIn = Eigen::Tensor<InEigenType, Rank>;
+ using TOut = Eigen::Tensor<OutEigenType, 0>;
+
+protected:
+ TosaReference::TensorTemplate<TIn>* in;
+ TosaReference::TensorTemplate<TOut>* out;
+ TosaAxisAttribute* attribute;
+};
+
template <int InRank, int OutRank, TOSA_REF_TYPE Dtype>
class OpReshape : public GraphNode
{