aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/ops/data_layout.h
diff options
context:
space:
mode:
authorTai Ly <tai.ly@arm.com>2024-01-25 22:00:18 +0000
committerEric Kunze <eric.kunze@arm.com>2024-01-30 17:35:41 +0000
commite095da79cc3575c8cbf818acd8a856ba136b0927 (patch)
tree2f400f2d5b13d465256d65030e35675f9abb3c38 /reference_model/src/ops/data_layout.h
parent455e8700fbd7c249dd6b5ea63869026b5e995669 (diff)
downloadreference_model-e095da79cc3575c8cbf818acd8a856ba136b0927.tar.gz
[ref model] Change PadOp's padding to Shape
Changed to use pad input of PadOp for testing. The pad input is now a tensor of tosa.shape type. moved padding error checking from checkTensorAttributes to eval modified pad's PadOutputShapeMismatch test generation to avoid generating output shapes with dimensions <= 0 Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I437c86d9a012903458a648667f6693db67b97d76
Diffstat (limited to 'reference_model/src/ops/data_layout.h')
-rw-r--r--reference_model/src/ops/data_layout.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/reference_model/src/ops/data_layout.h b/reference_model/src/ops/data_layout.h
index 9341709..e085b8e 100644
--- a/reference_model/src/ops/data_layout.h
+++ b/reference_model/src/ops/data_layout.h
@@ -54,14 +54,17 @@ public:
virtual int checkTensorAttributes();
virtual int eval();
- 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 TPadding = Eigen::Tensor<InEigenShapeType, 1>;
+ using TOut = Eigen::Tensor<OutEigenType, Rank>;
protected:
Eigen::array<std::pair<ptrdiff_t, ptrdiff_t>, Rank> paddings_array;
TosaReference::TensorTemplate<TIn>* in;
+ TosaReference::TensorTemplate<TPadding>* padding;
TosaReference::TensorTemplate<TOut>* out;
TosaPadAttribute* attribute;
};