aboutsummaryrefslogtreecommitdiff
path: root/test/TestTensor.hpp
blob: 1cd1950da0b755657416019f9bebe9ba1a23b781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once

#include "../ArmnnDriver.hpp"

#include <armnn/utility/Assert.hpp>

namespace driverTestHelpers
{

class TestTensor
{
public:
    TestTensor(const armnn::TensorShape & shape,
               const std::vector<float> & data)
    : m_Shape{shape}
    , m_Data{data}
    {
        ARMNN_ASSERT(m_Shape.GetNumElements() == m_Data.size());
    }

    hidl_vec<uint32_t> GetDimensions() const;
    unsigned int GetNumElements() const;
    const float * GetData() const;

private:
    armnn::TensorShape   m_Shape;
    std::vector<float>   m_Data;
};

} // driverTestHelpers