blob: 56ff9828bea71af20083c1e7221e35e1c5ba207f [file] [log] [blame]
Keith Davis300ad562020-06-04 16:34:23 +01001//
Teresa Charlinacb3ec52023-04-03 19:57:00 +01002// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved.
Keith Davis300ad562020-06-04 16:34:23 +01003// SPDX-License-Identifier: MIT
4//
5
Keith Davis300ad562020-06-04 16:34:23 +01006#include "ParserFlatbuffersSerializeFixture.hpp"
Finn Williams85d36712021-01-26 22:30:06 +00007#include <armnnDeserializer/IDeserializer.hpp>
Keith Davis300ad562020-06-04 16:34:23 +01008
9#include <string>
10
Sadik Armagan1625efc2021-06-10 18:24:34 +010011TEST_SUITE("Deserializer_Fill")
12{
Keith Davis300ad562020-06-04 16:34:23 +010013struct FillFixture : public ParserFlatbuffersSerializeFixture
14{
15 explicit FillFixture()
16 {
17 m_JsonString = R"(
18 {
19 layers: [
20 {
21 layer_type: "InputLayer",
22 layer: {
23 base: {
24 base: {
25 layerName: "InputLayer",
26 layerType: "Input",
27 inputSlots: [
28
29 ],
30 outputSlots: [
31 {
32 tensorInfo: {
33 dimensions: [
34 4
35 ],
Teresa Charlin4b10fef2020-07-29 09:36:41 +010036 dataType: "Signed32",
Teresa Charlinacb3ec52023-04-03 19:57:00 +010037 quantizationScale: 1.0
Keith Davis300ad562020-06-04 16:34:23 +010038 }
39 }
40 ]
41 }
42 }
43 }
44 },
45 {
46 layer_type: "FillLayer",
47 layer: {
48 base: {
49 index: 1,
50 layerName: "FillLayer",
51 layerType: "Fill",
52 inputSlots: [
53 {
54 connection: {
55 sourceLayerIndex: 0,
56 outputSlotIndex: 0
57 }
58 }
59 ],
60 outputSlots: [
61 {
62 tensorInfo: {
63 dimensions: [
64 1,
65 3,
66 3,
67 1
68 ],
69 dataType: "Float32",
70 quantizationScale: 0.0
71 }
72 }
73 ]
74 },
75 descriptor: {
76 value: 1.0
77 }
78 }
79 },
80 {
81 layer_type: "OutputLayer",
82 layer: {
83 base: {
84 base: {
85 index: 2,
86 layerName: "OutputLayer",
87 layerType: "Output",
88 inputSlots: [
89 {
90 connection: {
91 sourceLayerIndex: 1,
92 outputSlotIndex: 0
93 }
94 }
95 ],
96 outputSlots: [
97
98 ]
99 }
100 }
101 }
102 }
103 ],
104 inputIds: [
105 0
106 ],
107 outputIds: [
108 0
109 ],
110 featureVersions: {
111 bindingIdsScheme: 1
112 }
113 }
114 )";
115 Setup();
116 }
117};
118
119
120struct SimpleFillFixture : FillFixture
121{
122 SimpleFillFixture() : FillFixture() {}
123};
124
Sadik Armagan1625efc2021-06-10 18:24:34 +0100125TEST_CASE_FIXTURE(SimpleFillFixture, "Fill")
Keith Davis300ad562020-06-04 16:34:23 +0100126{
Teresa Charlin4b10fef2020-07-29 09:36:41 +0100127 RunTest<4, armnn::DataType::Signed32, armnn::DataType::Float32>(
Keith Davis300ad562020-06-04 16:34:23 +0100128 0,
129 {{"InputLayer", { 1, 3, 3, 1 }}},
130 {{"OutputLayer",{ 1, 1, 1, 1, 1, 1, 1, 1, 1}}});
131}
132
Sadik Armagan1625efc2021-06-10 18:24:34 +0100133}