aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/ops/data_layout.h
diff options
context:
space:
mode:
authorTai Ly <tai.ly@arm.com>2023-12-18 20:40:24 +0000
committerTai Ly <tai.ly@arm.com>2024-01-18 23:50:04 +0000
commit8690a0873fac28acccbb0acb15c16e8337e14df1 (patch)
treea13d5e195d8b7becffc23da98fde7449e91c96e4 /reference_model/src/ops/data_layout.h
parent9f5febe05901bfbd3919ef17f2caea8087cd9ccf (diff)
downloadreference_model-8690a0873fac28acccbb0acb15c16e8337e14df1.tar.gz
[reference model] Add shape operators
- fixed up reshape conformance tests to use shape input instead of attribute - fixed up tile conformance tests to use shape input instead of attribute - fixed output and output rank of dim op - allow rank 0 and rank 1 tensors for tosa.shape values (for shape = {}) - added initialization of rank 0 const_shape tensors (for shape = {}) - Update conformance tests to use new rescale attributes Signed-off-by: Tai Ly <tai.ly@arm.com> Signed-off-by: Won Jeon <won.jeon@arm.com> Change-Id: I6cce0d2a9ab066fe20a2abf9d2cfde3eb3d8c18b
Diffstat (limited to 'reference_model/src/ops/data_layout.h')
-rw-r--r--reference_model/src/ops/data_layout.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/reference_model/src/ops/data_layout.h b/reference_model/src/ops/data_layout.h
index 024f9a2..9341709 100644
--- a/reference_model/src/ops/data_layout.h
+++ b/reference_model/src/ops/data_layout.h
@@ -1,5 +1,5 @@
-// Copyright (c) 2020-2023, ARM Limited.
+// Copyright (c) 2020-2024, ARM Limited.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -79,7 +79,7 @@ public:
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>;
+ using TOut = Eigen::Tensor<OutEigenType, 1>;
protected:
TosaReference::TensorTemplate<TIn>* in;
@@ -107,7 +107,6 @@ protected:
Eigen::array<Eigen::Index, InRank> in_reverser;
Eigen::array<Eigen::Index, OutRank> out_reverser;
TosaReference::TensorTemplate<TIn>* in;
- TosaReshapeAttribute* attribute;
TosaReference::TensorTemplate<TOut>* out;
};
@@ -165,14 +164,17 @@ public:
virtual int checkTensorAttributes();
- using InEigenType = typename GetEigenType<Dtype>::type;
- using OutEigenType = typename GetEigenType<Dtype>::type;
- using TIn = Eigen::Tensor<InEigenType, Rank>;
- using TOut = Eigen::Tensor<OutEigenType, Rank>;
+ using InEigenType = typename GetEigenType<Dtype>::type;
+ using InEigenShapeType = typename GetEigenType<TOSA_REF_TYPE_SHAPE>::type;
+ using OutEigenType = typename GetEigenType<Dtype>::type;
+ using TIn = Eigen::Tensor<InEigenType, Rank>;
+ using TInMultiples = Eigen::Tensor<InEigenShapeType, 1>;
+ using TOut = Eigen::Tensor<OutEigenType, Rank>;
protected:
TosaTileAttribute* attribute;
TosaReference::TensorTemplate<TIn>* in;
+ TosaReference::TensorTemplate<TInMultiples>* multiples;
TosaReference::TensorTemplate<TOut>* out;
};