blob: b49910adf68e873830bec5c0559095bf97239831 [file] [log] [blame]
Keith Davis0176fd82021-06-01 17:36:32 +01001//
2// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "ShapeTestHelper.hpp"
7
8#include <doctest/doctest.h>
9
10namespace armnnDelegate
11{
12
13void ShapeSimpleTest(std::vector<armnn::BackendId>& backends)
14{
15 std::vector<int32_t> inputShape{ 1, 3, 2, 3 };
16
17 std::vector<int32_t> inputValues{ 1, 1, 1, 1, 1, 1, 1, 1,
18 1, 1, 1, 1, 1, 1, 1, 1, };
19
20 std::vector<int32_t> expectedOutputShape{ 4 };
21 std::vector<int32_t> expectedOutputValues{ 1, 3, 2, 3 };
22
23 ShapeTest<int32_t, int32_t>(::tflite::TensorType_INT32,
24 ::tflite::TensorType_INT32,
25 backends,
26 inputShape,
27 inputValues,
28 expectedOutputValues,
29 expectedOutputShape);
30}
31
32// SHAPE Test Suite
33TEST_SUITE("SHAPE_CpuRefTests")
34{
35
36TEST_CASE("SHAPE_Simple_CpuRef_Test")
37{
38 std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef };
39 ShapeSimpleTest(backends);
40}
41
42}
43// End of SHAPE Test Suite
44
45} // namespace armnnDelegate