aboutsummaryrefslogtreecommitdiff
path: root/delegate/test/TileTest.cpp
blob: 545ceeb5d555875fe58be64fe8a7ff827fdb5f9c (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
//
// Copyright © 2023-2024 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "TileTestHelper.hpp"

#include <doctest/doctest.h>

namespace armnnDelegate
{
void TileFloat32Test()
{
    // Set input data
    std::vector<float> inputValues =
    {
        0.f, 1.f, 2.f,
        3.f, 4.f, 5.f
    };

    // Set output data
    std::vector<float> expectedOutputValues =
    {
        0.f, 1.f, 2.f, 0.f, 1.f, 2.f,
        3.f, 4.f, 5.f, 3.f, 4.f, 5.f,

        0.f, 1.f, 2.f, 0.f, 1.f, 2.f,
        3.f, 4.f, 5.f, 3.f, 4.f, 5.f
    };

    // The multiples
    const std::vector<int32_t> multiplesValues = { 2, 2 };

    // Set shapes
    const std::vector<int32_t> inputShape = { 2, 3 };
    const std::vector<int32_t> multiplesShape = { 2 };
    const std::vector<int32_t> expectedOutputShape = { 4, 6 };

    TileFP32TestImpl(tflite::BuiltinOperator_TILE,
                     inputValues,
                     inputShape,
                     multiplesValues,
                     multiplesShape,
                     expectedOutputValues,
                     expectedOutputShape);
}

TEST_SUITE("TileTestsTests")
{

    TEST_CASE ("Tile_Float32_Test")
    {
        TileFloat32Test();
    }

} // TEST_SUITE("Tile_Float32_Test")

} // namespace armnnDelegate