blob: 1cd1950da0b755657416019f9bebe9ba1a23b781 [file] [log] [blame]
surmeh0149b9e102018-05-17 14:11:25 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
David Beck93e48982018-09-05 13:05:09 +01003// SPDX-License-Identifier: MIT
surmeh0149b9e102018-05-17 14:11:25 +01004//
5#pragma once
6
7#include "../ArmnnDriver.hpp"
8
Narumol Prangnawarat4d07e5e2020-04-06 16:46:21 +01009#include <armnn/utility/Assert.hpp>
10
surmeh0149b9e102018-05-17 14:11:25 +010011namespace driverTestHelpers
12{
13
14class TestTensor
15{
16public:
17 TestTensor(const armnn::TensorShape & shape,
18 const std::vector<float> & data)
19 : m_Shape{shape}
20 , m_Data{data}
21 {
Narumol Prangnawarat4d07e5e2020-04-06 16:46:21 +010022 ARMNN_ASSERT(m_Shape.GetNumElements() == m_Data.size());
surmeh0149b9e102018-05-17 14:11:25 +010023 }
24
25 hidl_vec<uint32_t> GetDimensions() const;
26 unsigned int GetNumElements() const;
27 const float * GetData() const;
28
29private:
30 armnn::TensorShape m_Shape;
31 std::vector<float> m_Data;
32};
33
34} // driverTestHelpers