From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- 20.02/_output_shape_of_squeeze_8cpp_source.xhtml | 125 +++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 20.02/_output_shape_of_squeeze_8cpp_source.xhtml (limited to '20.02/_output_shape_of_squeeze_8cpp_source.xhtml') diff --git a/20.02/_output_shape_of_squeeze_8cpp_source.xhtml b/20.02/_output_shape_of_squeeze_8cpp_source.xhtml new file mode 100644 index 0000000000..1dae1c7706 --- /dev/null +++ b/20.02/_output_shape_of_squeeze_8cpp_source.xhtml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + +ArmNN: src/armnnTfLiteParser/test/OutputShapeOfSqueeze.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
OutputShapeOfSqueeze.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include <boost/test/unit_test.hpp>
7 #include "../TfLiteParser.hpp"
8 #include <iostream>
9 #include <string>
10 
11 struct TfLiteParserFixture
12 {
13 
15  unsigned int m_InputShape[4];
16 
17  TfLiteParserFixture() : m_Parser( ), m_InputShape { 1, 2, 2, 1 } {
18  m_Parser.Create();
19  }
20  ~TfLiteParserFixture() { }
21 
22 };
23 
24 BOOST_AUTO_TEST_SUITE(TensorflowLiteParser);
25 
26 
27 BOOST_FIXTURE_TEST_CASE( EmptySqueezeDims_OutputWithAllDimensionsSqueezed, TfLiteParserFixture )
28 {
29 
30  std::vector<uint32_t> squeezeDims = { };
31 
32  armnn::TensorInfo inputTensorInfo = armnn::TensorInfo(4, m_InputShape, armnn::DataType::Float32);
33  armnn::TensorInfo outputTensorInfo = m_Parser.OutputShapeOfSqueeze(squeezeDims, inputTensorInfo);
34  BOOST_TEST(outputTensorInfo.GetNumElements() == 4);
35  BOOST_TEST(outputTensorInfo.GetNumDimensions() == 2);
36  BOOST_TEST((outputTensorInfo.GetShape() == armnn::TensorShape({ 2, 2 })));
37 };
38 
39 BOOST_FIXTURE_TEST_CASE( SqueezeDimsNotIncludingSizeOneDimensions_NoDimensionsSqueezedInOutput, TfLiteParserFixture )
40 {
41  std::vector<uint32_t> squeezeDims = { 1, 2 };
42 
43  armnn::TensorInfo inputTensorInfo = armnn::TensorInfo(4, m_InputShape, armnn::DataType::Float32);
44  armnn::TensorInfo outputTensorInfo = m_Parser.OutputShapeOfSqueeze(squeezeDims, inputTensorInfo);
45  BOOST_TEST(outputTensorInfo.GetNumElements() == 4);
46  BOOST_TEST(outputTensorInfo.GetNumDimensions() == 4);
47  BOOST_TEST((outputTensorInfo.GetShape() == armnn::TensorShape({ 1, 2, 2, 1 })));
48 };
49 
50 BOOST_FIXTURE_TEST_CASE( SqueezeDimsRangePartial_OutputWithDimensionsWithinRangeSqueezed, TfLiteParserFixture )
51 {
52  std::vector<uint32_t> squeezeDims = { 1, 3 };
53 
54  armnn::TensorInfo inputTensorInfo = armnn::TensorInfo(4, m_InputShape, armnn::DataType::Float32);
55  armnn::TensorInfo outputTensorInfo = m_Parser.OutputShapeOfSqueeze(squeezeDims, inputTensorInfo);
56  BOOST_TEST(outputTensorInfo.GetNumElements() == 4);
57  BOOST_TEST(outputTensorInfo.GetNumDimensions() == 3);
58  BOOST_TEST((outputTensorInfo.GetShape() == armnn::TensorShape({ 1, 2, 2 })));
59 };
60 
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
+
BOOST_FIXTURE_TEST_CASE(EmptySqueezeDims_OutputWithAllDimensionsSqueezed, TfLiteParserFixture)
+
const TensorShape & GetShape() const
Definition: Tensor.hpp:88
+ + + +
static ITfLiteParserPtr Create(const armnn::Optional< TfLiteParserOptions > &options=armnn::EmptyOptional())
+
BOOST_AUTO_TEST_SUITE_END()
+
static armnn::TensorInfo OutputShapeOfSqueeze(const std::vector< uint32_t > &squeezeDims, const armnn::TensorInfo &inputTensorInfo)
+ +
unsigned int GetNumDimensions() const
Definition: Tensor.hpp:92
+
unsigned int GetNumElements() const
Definition: Tensor.hpp:93
+
+
+ + + + -- cgit v1.2.1