2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
6 #include <boost/test/unit_test.hpp>
7 #include "armnnTfParser/ITfParser.hpp"
8 #include "ParserPrototxtFixture.hpp"
10 BOOST_AUTO_TEST_SUITE(TensorflowParser)
12 struct UnsupportedMaximumFixture
13 : public armnnUtils::ParserPrototxtFixture<armnnTfParser::ITfParser>
15 UnsupportedMaximumFixture()
51 BOOST_FIXTURE_TEST_CASE(UnsupportedMaximum, UnsupportedMaximumFixture)
54 SetupSingleInputSingleOutput({ 1, 1 }, "graphInput", "Maximum"),
55 armnn::ParseException);
58 struct SupportedMaximumFixture
59 : public armnnUtils::ParserPrototxtFixture<armnnTfParser::ITfParser>
61 SupportedMaximumFixture(const std::string & maxInput0,
62 const std::string & maxInput1,
63 const std::string & mulInput0,
64 const std::string & mulInput1)
72 value { type: DT_FLOAT }
84 value { type: DT_FLOAT }
102 input: ")" + mulInput0 + R"("
103 input: ")" + mulInput1 + R"("
106 value { type: DT_FLOAT }
112 input: ")" + maxInput0 + R"("
113 input: ")" + maxInput1 + R"("
116 value { type: DT_FLOAT }
120 SetupSingleInputSingleOutput({ 1, 2 }, "graphInput", "Maximum");
124 struct LeakyRelu_Max_MulAT_T_Fixture : public SupportedMaximumFixture
126 LeakyRelu_Max_MulAT_T_Fixture()
127 : SupportedMaximumFixture("Mul","graphInput","Alpha","graphInput") {}
130 BOOST_FIXTURE_TEST_CASE(LeakyRelu_Max_MulAT_T, LeakyRelu_Max_MulAT_T_Fixture)
132 RunTest<2>(std::vector<float>({-5.0, 3.0}), {-0.5, 3.0});
135 struct LeakyRelu_Max_T_MulAT_Fixture : public SupportedMaximumFixture
137 LeakyRelu_Max_T_MulAT_Fixture()
138 : SupportedMaximumFixture("graphInput","Mul","Alpha","graphInput") {}
142 BOOST_FIXTURE_TEST_CASE(LeakyRelu_Max_T_MulAT, LeakyRelu_Max_T_MulAT_Fixture)
144 RunTest<2>(std::vector<float>({-10.0, 3.0}), {-1.0, 3.0});
147 struct LeakyRelu_Max_MulTA_T_Fixture : public SupportedMaximumFixture
149 LeakyRelu_Max_MulTA_T_Fixture()
150 : SupportedMaximumFixture("Mul", "graphInput","graphInput","Alpha") {}
153 BOOST_FIXTURE_TEST_CASE(LeakyRelu_Max_MulTA_T, LeakyRelu_Max_MulTA_T_Fixture)
155 RunTest<2>(std::vector<float>({-5.0, 3.0}), {-0.5, 3.0});
158 struct LeakyRelu_Max_T_MulTA_Fixture : public SupportedMaximumFixture
160 LeakyRelu_Max_T_MulTA_Fixture()
161 : SupportedMaximumFixture("graphInput", "Mul", "graphInput", "Alpha") {}
164 BOOST_FIXTURE_TEST_CASE(LeakyRelu_Max_T_MulTA, LeakyRelu_Max_T_MulTA_Fixture)
166 RunTest<2>(std::vector<float>({-10.0, 13.0}), {-1.0, 13.0});
169 BOOST_AUTO_TEST_SUITE_END()