ArmNN  NotReleased
Split.cpp File Reference
#include <boost/test/unit_test.hpp>
#include "armnnTfParser/ITfParser.hpp"
#include "ParserPrototxtFixture.hpp"

Go to the source code of this file.

Functions

 BOOST_FIXTURE_TEST_CASE (ParseAxisOneSplitTwo, SplitFixture)
 
 BOOST_FIXTURE_TEST_CASE (ParseSplit, InputFirstSplitFixture)
 
 BOOST_FIXTURE_TEST_CASE (SplitLastDimTest, SplitLastDimFixture)
 

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE() [1/3]

BOOST_FIXTURE_TEST_CASE ( ParseAxisOneSplitTwo  ,
SplitFixture   
)

Definition at line 148 of file Split.cpp.

149 {
150  BOOST_TEST(
151  (m_Parser->GetNetworkOutputBindingInfo("Relu_1").second.GetShape() == armnn::TensorShape({ 1, 1, 2, 2 })));
152 
153  BOOST_TEST(
154  (m_Parser->GetNetworkOutputBindingInfo("Relu_2").second.GetShape() == armnn::TensorShape({ 1, 1, 2, 2 })));
155 
156  RunTest<4>({ { "graphInput", { -1.0f, -0.5f, 1.25f, -3.0f, 0.0f, 0.5f, -0.75f, 1.75f } } },
157  { { "Relu_1", { 0.0f, 0.0f, 1.25f, 0.0f } },
158  { "Relu_2", { 0.0f, 0.5f, 0.0f, 1.75f } } });
159 }

◆ BOOST_FIXTURE_TEST_CASE() [2/3]

BOOST_FIXTURE_TEST_CASE ( ParseSplit  ,
InputFirstSplitFixture   
)

Definition at line 161 of file Split.cpp.

162 {
163 
164  BOOST_TEST(
165  (m_Parser->GetNetworkOutputBindingInfo("Relu_1").second.GetShape() == armnn::TensorShape({ 1, 2, 2, 1 })));
166 
167  BOOST_TEST(
168  (m_Parser->GetNetworkOutputBindingInfo("Relu_2").second.GetShape() == armnn::TensorShape({ 1, 2, 2, 1 })));
169 
170  RunTest<4>({ { "graphInput", { -1.0f, -0.5f, 1.25f, -3.0f, 0.0f, 0.5f, -0.75f , 1.75f } } ,
171  { "graphInput2", { -1.0f, -0.5f, 1.25f, -3.0f, 0.0f, 0.5f, -0.75f , 1.75f } } },
172  { { "Relu_1", { 1.0f, 1.5625f, 0, 0.5625f } },
173  { "Relu_2", { 0.25, 9.0f, 0.25f, 3.0625f } } });
174 }

◆ BOOST_FIXTURE_TEST_CASE() [3/3]

BOOST_FIXTURE_TEST_CASE ( SplitLastDimTest  ,
SplitLastDimFixture   
)

Definition at line 378 of file Split.cpp.

References BOOST_AUTO_TEST_SUITE_END().

379 {
380  BOOST_TEST(
381  (m_Parser->GetNetworkOutputBindingInfo("sub0").second.GetShape() == armnn::TensorShape({ 1, 2, 2, 1 })));
382 
383  BOOST_TEST(
384  (m_Parser->GetNetworkOutputBindingInfo("sub1").second.GetShape() == armnn::TensorShape({ 1, 2, 2, 1 })));
385 
386  BOOST_TEST(
387  (m_Parser->GetNetworkOutputBindingInfo("sub2").second.GetShape() == armnn::TensorShape({ 1, 2, 2, 1 })));
388 
389  RunTest<4>({ { "Placeholder", { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f } } },
390  { { "sub0", { -2.0f, 1.0f, 4.0f, 7.0f } },
391  { "sub1", { 0.0f, 3.0f, 6.0f, 9.0f } },
392  { "sub2", { 2.0f, 5.0f, 8.0f, 11.0f } } });
393 }