• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <ArmnnDriver.hpp>
9 #include "DriverTestHelpers.hpp"
10 
11 namespace driverTestHelpers
12 {
13 
14 class TestTensor
15 {
16 public:
TestTensor(const armnn::TensorShape & shape,const std::vector<float> & data)17     TestTensor(const armnn::TensorShape & shape,
18                const std::vector<float> & data)
19     : m_Shape{shape}
20     , m_Data{data}
21     {
22         DOCTEST_CHECK(m_Shape.GetNumElements() == m_Data.size());
23     }
24 
25     hidl_vec<uint32_t> GetDimensions() const;
26     unsigned int GetNumElements() const;
27     const float * GetData() const;
28 
29 private:
30     armnn::TensorShape   m_Shape;
31     std::vector<float>   m_Data;
32 };
33 
34 } // driverTestHelpers
35