blob: 0766ef50a6b0878997caf6b1525713c4264ad7c6 [file] [log] [blame]
surmeh0149b9e102018-05-17 14:11:25 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// See LICENSE file in the project root for full license information.
4//
5#include "TestTensor.hpp"
6
7namespace driverTestHelpers
8{
9
10hidl_vec<uint32_t> TestTensor::GetDimensions() const
11{
12 hidl_vec<uint32_t> dimensions;
13 dimensions.resize(m_Shape.GetNumDimensions());
14 for (uint32_t i=0; i<m_Shape.GetNumDimensions(); ++i)
15 {
16 dimensions[i] = m_Shape[i];
17 }
18 return dimensions;
19}
20
21unsigned int TestTensor::GetNumElements() const
22{
23 return m_Shape.GetNumElements();
24}
25
26const float * TestTensor::GetData() const
27{
28 BOOST_ASSERT(m_Data.empty() == false);
29 return &m_Data[0];
30}
31
32} // namespace driverTestHelpers