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 FusedBatchNormFixture : public armnnUtils::ParserPrototxtFixture<armnnTfParser::ITfParser>
14 FusedBatchNormFixture()
16 m_Prototext = "node { \n"
17 " name: \"graphInput\" \n"
18 " op: \"Placeholder\" \n"
34 " name: \"Const_1\" \n"
58 " name: \"Const_2\" \n"
82 " name: \"FusedBatchNormLayer/mean\" \n"
106 " name: \"FusedBatchNormLayer/variance\" \n"
118 " dtype: DT_FLOAT \n"
130 " name: \"output\" \n"
131 " op: \"FusedBatchNorm\" \n"
132 " input: \"graphInput\" \n"
133 " input: \"Const_1\" \n"
134 " input: \"Const_2\" \n"
135 " input: \"FusedBatchNormLayer/mean\" \n"
136 " input: \"FusedBatchNormLayer/variance\" \n"
144 " key: \"data_format\" \n"
150 " key: \"epsilon\" \n"
152 " f: 0.0010000000475 \n"
156 " key: \"is_training\" \n"
163 SetupSingleInputSingleOutput({1, 3, 3, 1}, "graphInput", "output");
167 BOOST_FIXTURE_TEST_CASE(ParseFusedBatchNorm, FusedBatchNormFixture)
169 RunTest<4>({1, 2, 3, 4, 5, 6, 7, 8, 9}, // Input data.
170 {-2.8277204f, -2.12079024f, -1.4138602f,
171 -0.7069301f, 0.0f, 0.7069301f,
172 1.4138602f, 2.12079024f, 2.8277204f}); // Expected output data.
175 BOOST_AUTO_TEST_SUITE_END()