ArmNN
 21.02
Reshape.cpp File Reference
#include <boost/test/unit_test.hpp>
#include "ParserFlatbuffersFixture.hpp"
#include "../TfLiteParser.hpp"
#include <string>
#include <iostream>

Go to the source code of this file.

Functions

 BOOST_FIXTURE_TEST_CASE (ParseReshapeWithReshapeDims, ReshapeFixtureWithReshapeDims)
 
 BOOST_FIXTURE_TEST_CASE (ParseReshapeWithReshapeDimsFlatten, ReshapeFixtureWithReshapeDimsFlatten)
 
 BOOST_FIXTURE_TEST_CASE (ParseReshapeWithReshapeDimsFlattenTwoDims, ReshapeFixtureWithReshapeDimsFlattenTwoDims)
 
 BOOST_FIXTURE_TEST_CASE (ParseReshapeWithReshapeDimsFlattenOneDim, ReshapeFixtureWithReshapeDimsFlattenOneDim)
 
 BOOST_FIXTURE_TEST_CASE (DynParseReshapeWithReshapeDimsFlattenOneDim, DynamicReshapeFixtureWithReshapeDimsFlattenOneDim)
 

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE() [1/5]

BOOST_FIXTURE_TEST_CASE ( ParseReshapeWithReshapeDims  ,
ReshapeFixtureWithReshapeDims   
)

Definition at line 86 of file Reshape.cpp.

87 {
88  SetupSingleInputSingleOutput("inputTensor", "outputTensor");
89  RunTest<2, armnn::DataType::QAsymmU8>(0,
90  { 1, 2, 3, 4, 5, 6, 7, 8, 9 },
91  { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
92  BOOST_TEST((m_Parser->GetNetworkOutputBindingInfo(0, "outputTensor").second.GetShape()
93  == armnn::TensorShape({3,3})));
94 }

◆ BOOST_FIXTURE_TEST_CASE() [2/5]

BOOST_FIXTURE_TEST_CASE ( ParseReshapeWithReshapeDimsFlatten  ,
ReshapeFixtureWithReshapeDimsFlatten   
)

Definition at line 101 of file Reshape.cpp.

102 {
103  SetupSingleInputSingleOutput("inputTensor", "outputTensor");
104  RunTest<1, armnn::DataType::QAsymmU8>(0,
105  { 1, 2, 3, 4, 5, 6, 7, 8, 9 },
106  { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
107  BOOST_TEST((m_Parser->GetNetworkOutputBindingInfo(0, "outputTensor").second.GetShape()
108  == armnn::TensorShape({9})));
109 }

◆ BOOST_FIXTURE_TEST_CASE() [3/5]

BOOST_FIXTURE_TEST_CASE ( ParseReshapeWithReshapeDimsFlattenTwoDims  ,
ReshapeFixtureWithReshapeDimsFlattenTwoDims   
)

Definition at line 116 of file Reshape.cpp.

117 {
118  SetupSingleInputSingleOutput("inputTensor", "outputTensor");
119  RunTest<2, armnn::DataType::QAsymmU8>(0,
120  { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 },
121  { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 });
122  BOOST_TEST((m_Parser->GetNetworkOutputBindingInfo(0, "outputTensor").second.GetShape()
123  == armnn::TensorShape({2,9})));
124 }

◆ BOOST_FIXTURE_TEST_CASE() [4/5]

BOOST_FIXTURE_TEST_CASE ( ParseReshapeWithReshapeDimsFlattenOneDim  ,
ReshapeFixtureWithReshapeDimsFlattenOneDim   
)

Definition at line 131 of file Reshape.cpp.

132 {
133  SetupSingleInputSingleOutput("inputTensor", "outputTensor");
134  RunTest<3, armnn::DataType::QAsymmU8>(0,
135  { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 },
136  { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 });
137  BOOST_TEST((m_Parser->GetNetworkOutputBindingInfo(0, "outputTensor").second.GetShape()
138  == armnn::TensorShape({2,3,3})));
139 }

◆ BOOST_FIXTURE_TEST_CASE() [5/5]

BOOST_FIXTURE_TEST_CASE ( DynParseReshapeWithReshapeDimsFlattenOneDim  ,
DynamicReshapeFixtureWithReshapeDimsFlattenOneDim   
)

Definition at line 148 of file Reshape.cpp.

References BOOST_AUTO_TEST_SUITE_END(), and armnn::QAsymmU8.

149 {
150  SetupSingleInputSingleOutput("inputTensor", "outputTensor");
151  RunTest<3,
153  armnn::DataType::QAsymmU8>(0,
154  { { "inputTensor", { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 } } },
155  { { "outputTensor", { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6 } } },
156  true);
157 }