aboutsummaryrefslogtreecommitdiff
path: root/test/TestTensor.hpp
diff options
context:
space:
mode:
authorsurmeh01 <surabhi.mehta@arm.com>2018-05-17 14:11:25 +0100
committertelsoa01 <telmo.soares@arm.com>2018-05-23 16:23:49 +0100
commit49b9e100bfbb3b8da01472a0ff48b2bd92944e01 (patch)
tree1a998fa12f665ff0a15b299d8bae5590e0aed884 /test/TestTensor.hpp
parent28adb40e1bb1d3f3a06a7f333f7f2a4f42d3ed4b (diff)
downloadandroid-nn-driver-49b9e100bfbb3b8da01472a0ff48b2bd92944e01.tar.gz
Release 18.05
Diffstat (limited to 'test/TestTensor.hpp')
-rw-r--r--test/TestTensor.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/TestTensor.hpp b/test/TestTensor.hpp
new file mode 100644
index 00000000..974e7b93
--- /dev/null
+++ b/test/TestTensor.hpp
@@ -0,0 +1,32 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// See LICENSE file in the project root for full license information.
+//
+#pragma once
+
+#include "../ArmnnDriver.hpp"
+
+namespace driverTestHelpers
+{
+
+class TestTensor
+{
+public:
+ TestTensor(const armnn::TensorShape & shape,
+ const std::vector<float> & data)
+ : m_Shape{shape}
+ , m_Data{data}
+ {
+ BOOST_ASSERT(m_Shape.GetNumElements() == m_Data.size());
+ }
+
+ hidl_vec<uint32_t> GetDimensions() const;
+ unsigned int GetNumElements() const;
+ const float * GetData() const;
+
+private:
+ armnn::TensorShape m_Shape;
+ std::vector<float> m_Data;
+};
+
+} // driverTestHelpers