File: ShapeTest.cpp

package info (click to toggle)
armnn 23.08-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 53,580 kB
  • sloc: cpp: 337,440; python: 4,755; sh: 1,708; makefile: 42; asm: 15; xml: 6
file content (45 lines) | stat: -rw-r--r-- 1,181 bytes parent folder | download
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
//
// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "ShapeTestHelper.hpp"

#include <doctest/doctest.h>

namespace armnnDelegate
{

void ShapeSimpleTest(std::vector<armnn::BackendId>& backends)
{
    std::vector<int32_t> inputShape{ 1, 3, 2, 3 };

    std::vector<int32_t> inputValues{ 1, 1, 1, 1, 1, 1, 1, 1,
                                      1, 1, 1, 1, 1, 1, 1, 1, };

    std::vector<int32_t> expectedOutputShape{ 4 };
    std::vector<int32_t> expectedOutputValues{ 1, 3, 2, 3 };

    ShapeTest<int32_t, int32_t>(::tflite::TensorType_INT32,
                                ::tflite::TensorType_INT32,
                                backends,
                                inputShape,
                                inputValues,
                                expectedOutputValues,
                                expectedOutputShape);
}

// SHAPE Test Suite
TEST_SUITE("SHAPE_CpuRefTests")
{

TEST_CASE("SHAPE_Simple_CpuRef_Test")
{
    std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef };
    ShapeSimpleTest(backends);
}

}
// End of SHAPE Test Suite

} // namespace armnnDelegate