21.11
DeserializeShape.cpp
Go to the documentation of this file.
1
//
2
// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
3
// SPDX-License-Identifier: MIT
4
//
5
6
#include "
ParserFlatbuffersSerializeFixture.hpp
"
7
#include <
armnnDeserializer/IDeserializer.hpp
>
8
9
#include <doctest/doctest.h>
10
11
#include <string>
12
13
TEST_SUITE
(
"Deserializer_Shape"
)
14
{
15
struct
ShapeFixture :
public
ParserFlatbuffersSerializeFixture
16
{
17
explicit
ShapeFixture()
18
{
19
m_JsonString = R
"(
20
{
21
layers: [
22
{
23
layer_type: "InputLayer",
24
layer: {
25
base: {
26
base: {
27
layerName: "InputLayer",
28
layerType: "Input",
29
inputSlots: [
30
31
],
32
outputSlots: [
33
{
34
tensorInfo: {
35
dimensions: [
36
1,
37
3,
38
3,
39
1
40
],
41
dataType: "Signed32",
42
quantizationScale: 0.0
43
}
44
}
45
]
46
}
47
}
48
}
49
},
50
{
51
layer_type: "ShapeLayer",
52
layer: {
53
base: {
54
index: 1,
55
layerName: "shape",
56
layerType: "Shape",
57
inputSlots: [
58
{
59
connection: {
60
sourceLayerIndex: 0,
61
outputSlotIndex: 0
62
}
63
}
64
],
65
outputSlots: [
66
{
67
tensorInfo: {
68
dimensions: [
69
4
70
],
71
dataType: "Signed32",
72
quantizationScale: 0.0
73
}
74
}
75
]
76
}
77
}
78
},
79
{
80
layer_type: "OutputLayer",
81
layer: {
82
base: {
83
base: {
84
index: 2,
85
layerName: "OutputLayer",
86
layerType: "Output",
87
inputSlots: [
88
{
89
connection: {
90
sourceLayerIndex: 1,
91
outputSlotIndex: 0
92
}
93
}
94
],
95
outputSlots: [
96
97
]
98
}
99
}
100
}
101
}
102
],
103
inputIds: [
104
0
105
],
106
outputIds: [
107
0
108
],
109
featureVersions: {
110
bindingIdsScheme: 1
111
}
112
}
113
)";
114
Setup
();
115
}
116
};
117
118
struct
SimpleShapeFixture : ShapeFixture
119
{
120
SimpleShapeFixture() : ShapeFixture() {}
121
};
122
123
TEST_CASE_FIXTURE
(SimpleShapeFixture,
"DeserializeShape"
)
124
{
125
RunTest<1, armnn::DataType::Signed32>(
126
0,
127
{{
"InputLayer"
, { 1, 1, 1, 1, 1, 1, 1, 1, 1 }}},
128
{{
"OutputLayer"
,{ 1, 3, 3, 1 }}});
129
}
130
131
}
ParserFlatbuffersSerializeFixture::Setup
void Setup()
Definition:
ParserFlatbuffersSerializeFixture.hpp:49
TEST_SUITE
TEST_SUITE("Deserializer_Shape")
Definition:
DeserializeShape.cpp:13
TEST_CASE_FIXTURE
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")
Definition:
MemCopyTests.cpp:45
ParserFlatbuffersSerializeFixture
Definition:
ParserFlatbuffersSerializeFixture.hpp:29
ParserFlatbuffersSerializeFixture.hpp
IDeserializer.hpp
src
armnnDeserializer
test
DeserializeShape.cpp
Generated on Wed Nov 17 2021 12:59:01 for ArmNN by
1.8.13