aboutsummaryrefslogtreecommitdiff
path: root/src/backends/tosaCommon/test/TosaTestUtils.hpp
diff options
context:
space:
mode:
authorCathal Corbett <cathal.corbett@arm.com>2022-12-09 12:17:27 +0000
committerTeresaARM <teresa.charlinreyes@arm.com>2022-12-13 12:13:20 +0000
commit3b9acd515918ac1af5498b3e7501c0b16a88a8e0 (patch)
treea537cbdd7c45fea1772cbb34f8a23ecc7dbd6e1a /src/backends/tosaCommon/test/TosaTestUtils.hpp
parent8107ccce5167f160b9c98a6042878dd0408220b5 (diff)
downloadarmnn-3b9acd515918ac1af5498b3e7501c0b16a88a8e0.tar.gz
IVGCVSW-7342 Add Slice support to TOSA Reference Backend
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com> Change-Id: I8be286b69bebd4cd36033e3145632bb043938d16
Diffstat (limited to 'src/backends/tosaCommon/test/TosaTestUtils.hpp')
-rw-r--r--src/backends/tosaCommon/test/TosaTestUtils.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/backends/tosaCommon/test/TosaTestUtils.hpp b/src/backends/tosaCommon/test/TosaTestUtils.hpp
index 5c10a6d638..93b9e7d36f 100644
--- a/src/backends/tosaCommon/test/TosaTestUtils.hpp
+++ b/src/backends/tosaCommon/test/TosaTestUtils.hpp
@@ -122,6 +122,27 @@ inline void VerifyTosaAttribute(const BaseDescriptor& descriptor,
1,
std::multiplies<int32_t>());
CHECK(numInputElements == numAttributeShapeElements);
+
+ break;
+ }
+ case LayerType::Slice:
+ {
+ auto sliceDesc = PolymorphicDowncast<const SliceDescriptor*>(&descriptor);
+ TosaSliceAttribute reshapeAttribute(attribute);
+
+ std::vector<int32_t> begin(sliceDesc->m_Begin.begin(), sliceDesc->m_Begin.end());
+ std::vector<int32_t> size(sliceDesc->m_Size.begin(), sliceDesc->m_Size.end());
+
+ CHECK(begin == reshapeAttribute.start());
+ CHECK(size == reshapeAttribute.size());
+
+ CHECK(begin.size() == inputShape.size());
+ CHECK(size.size() == inputShape.size());
+
+ CHECK(begin.size() == outputShape.size());
+ CHECK(size.size() == outputShape.size());
+
+ break;
}
default:
break;