• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #include "TestTensor.hpp"
6 
7 namespace driverTestHelpers
8 {
9 
GetDimensions() const10 hidl_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 
GetNumElements() const21 unsigned int TestTensor::GetNumElements() const
22 {
23     return m_Shape.GetNumElements();
24 }
25 
GetData() const26 const float * TestTensor::GetData() const
27 {
28     ARMNN_ASSERT(m_Data.empty() == false);
29     return &m_Data[0];
30 }
31 
32 } // namespace driverTestHelpers
33