ArmNN
 22.02
Mean.cpp File Reference

Go to the source code of this file.

Functions

 TEST_SUITE ("TensorflowLiteParser_Mean")
 

Function Documentation

◆ TEST_SUITE()

TEST_SUITE ( "TensorflowLiteParser_Mean"  )

Definition at line 9 of file Mean.cpp.

References ParserFlatbuffersFixture::SetupSingleInputSingleOutput(), and TEST_CASE_FIXTURE().

10 {
11 struct MeanNoReduceFixture : public ParserFlatbuffersFixture
12 {
13  explicit MeanNoReduceFixture(const std::string & inputShape,
14  const std::string & outputShape,
15  const std::string & dimShape,
16  const std::string & dimData)
17  {
18  m_JsonString = R"(
19  {
20  "version": 3,
21  "operator_codes": [ { "builtin_code": "MEAN" } ],
22  "subgraphs": [ {
23  "tensors": [
24  {
25  "shape": )" + inputShape + R"(,
26  "type": "FLOAT32",
27  "buffer": 0,
28  "name": "inputTensor",
29  "quantization": {
30  "min": [ 0.0 ],
31  "max": [ 255.0 ],
32  "scale": [ 1.0 ],
33  "zero_point": [ 0 ],
34  }
35  },
36  {
37  "shape": )" + outputShape + R"( ,
38  "type": "FLOAT32",
39  "buffer": 1,
40  "name": "outputTensor",
41  "quantization": {
42  "min": [ 0.0 ],
43  "max": [ 255.0 ],
44  "scale": [ 1.0 ],
45  "zero_point": [ 0 ],
46  }
47  },
48  {
49  "shape": )" + dimShape + R"( ,
50  "type": "INT32",
51  "buffer": 2,
52  "name": "dimShape",
53  "quantization": {
54  "min": [ 0.0 ],
55  "max": [ 255.0 ],
56  "scale": [ 1.0 ],
57  "zero_point": [ 0 ],
58  }
59  }
60  ],
61  "inputs": [ 0 ],
62  "outputs": [ 1 ],
63  "operators": [
64  {
65  "opcode_index": 0,
66  "inputs": [ 0 , 2 ],
67  "outputs": [ 1 ],
68  "custom_options_format": "FLEXBUFFERS"
69  }
70  ],
71  } ],
72  "buffers" : [
73  { },
74  { },
75  { "data": )" + dimData + R"(, },
76  ]
77  }
78  )";
79  SetupSingleInputSingleOutput("inputTensor", "outputTensor");
80  }
81 };
82 
83 struct SimpleMeanNoReduceFixture : public MeanNoReduceFixture
84 {
85  SimpleMeanNoReduceFixture() : MeanNoReduceFixture("[ 2, 2 ]", "[ 1, 1 ]", "[ 0 ]", "[ ]") {}
86 };
87 
88 TEST_CASE_FIXTURE(SimpleMeanNoReduceFixture, "ParseMeanNoReduce")
89 {
90  RunTest<2, armnn::DataType::Float32>(0, {{ "inputTensor", { 1.0f, 1.0f, 2.0f, 2.0f } } },
91  {{ "outputTensor", { 1.5f } } });
92 }
93 
94 }
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)