diff options
author | surmeh01 <surabhi.mehta@arm.com> | 2018-05-17 14:11:25 +0100 |
---|---|---|
committer | telsoa01 <telmo.soares@arm.com> | 2018-05-23 16:23:49 +0100 |
commit | 49b9e100bfbb3b8da01472a0ff48b2bd92944e01 (patch) | |
tree | 1a998fa12f665ff0a15b299d8bae5590e0aed884 /test/TestTensor.cpp | |
parent | 28adb40e1bb1d3f3a06a7f333f7f2a4f42d3ed4b (diff) | |
download | android-nn-driver-49b9e100bfbb3b8da01472a0ff48b2bd92944e01.tar.gz |
Release 18.05
Diffstat (limited to 'test/TestTensor.cpp')
-rw-r--r-- | test/TestTensor.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/TestTensor.cpp b/test/TestTensor.cpp new file mode 100644 index 00000000..0766ef50 --- /dev/null +++ b/test/TestTensor.cpp @@ -0,0 +1,32 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// See LICENSE file in the project root for full license information. +// +#include "TestTensor.hpp" + +namespace driverTestHelpers +{ + +hidl_vec<uint32_t> TestTensor::GetDimensions() const +{ + hidl_vec<uint32_t> dimensions; + dimensions.resize(m_Shape.GetNumDimensions()); + for (uint32_t i=0; i<m_Shape.GetNumDimensions(); ++i) + { + dimensions[i] = m_Shape[i]; + } + return dimensions; +} + +unsigned int TestTensor::GetNumElements() const +{ + return m_Shape.GetNumElements(); +} + +const float * TestTensor::GetData() const +{ + BOOST_ASSERT(m_Data.empty() == false); + return &m_Data[0]; +} + +} // namespace driverTestHelpers |