aboutsummaryrefslogtreecommitdiff
path: root/src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp
blob: ac6076496483bf0b19fe0a5ca96b68bfc31edb9b (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#pragma once

#include <armnn/Tensor.hpp>
#include <armnn/utility/Assert.hpp>

#include <cstddef>
#include <vector>

template <typename T, std::size_t n>
struct LayerTestResult
{
    LayerTestResult(const armnn::TensorInfo& outputInfo)
        : m_Supported(true)
        , m_CompareBoolean(false)
    {
        m_ActualData.reserve(outputInfo.GetNumElements());
        m_ExpectedData.reserve(outputInfo.GetNumElements());
        m_ActualShape = outputInfo.GetShape();
        m_ExpectedShape = outputInfo.GetShape();
    }

    LayerTestResult(const std::vector<T>& actualData,
                    const std::vector<T>& expectedData,
                    const armnn::TensorShape& actualShape,
                    const armnn::TensorShape& expectedShape)
        : m_ActualData(actualData)
        , m_ExpectedData(expectedData)
        , m_ActualShape(actualShape)
        , m_ExpectedShape(expectedShape)
        , m_Supported(true)
        , m_CompareBoolean(false)
    {}

    LayerTestResult(const std::vector<T>& actualData,
                    const std::vector<T>& expectedData,
                    const armnn::TensorShape& actualShape,
                    const armnn::TensorShape& expectedShape,
                    const bool compareBoolean)
        : m_ActualData(actualData)
        , m_ExpectedData(expectedData)
        , m_ActualShape(actualShape)
        , m_ExpectedShape(expectedShape)
        , m_Supported(true)
        , m_CompareBoolean(compareBoolean)
    {}

    std::vector<T> m_ActualData;
    std::vector<T> m_ExpectedData;
    armnn::TensorShape m_ActualShape;
    armnn::TensorShape m_ExpectedShape;

    bool m_Supported;
    bool m_CompareBoolean;
};