6 #include <boost/test/unit_test.hpp> 8 #include "../Deserializer.hpp" 17 explicit NormalizationFixture(
const std::string &inputShape,
18 const std::string & outputShape,
19 const std::string &dataType,
20 const std::string &normAlgorithmChannel,
21 const std::string &normAlgorithmMethod,
22 const std::string &dataLayout)
29 layer_type: "InputLayer", 35 layerName: "InputLayer", 39 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 44 dimensions: )" + inputShape + R"(, 45 dataType: )" + dataType + R"(, 46 quantizationScale: 0.5, 55 layer_type: "NormalizationLayer", 59 layerName: "NormalizationLayer", 60 layerType: "Normalization", 63 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 68 dimensions: )" + outputShape + R"(, 69 dataType: )" + dataType + R"( 74 normChannelType: )" + normAlgorithmChannel + R"(, 75 normMethodType: )" + normAlgorithmMethod + R"(, 80 dataLayout: )" + dataLayout + R"( 85 layer_type: "OutputLayer", 91 layerName: "OutputLayer", 95 connection: {sourceLayerIndex:1, outputSlotIndex:0 }, 100 dimensions: )" + outputShape + R"(, 101 dataType: )" + dataType + R"( 113 struct FloatNhwcLocalBrightnessAcrossNormalizationFixture : NormalizationFixture
115 FloatNhwcLocalBrightnessAcrossNormalizationFixture() : NormalizationFixture(
"[ 2, 2, 2, 1 ]",
"[ 2, 2, 2, 1 ]",
116 "Float32",
"0",
"0",
"NHWC") {}
122 RunTest<4, armnn::DataType::Float32>(0, { 1.0f, 2.0f, 3.0f, 4.0f,
123 5.0f, 6.0f, 7.0f, 8.0f },
124 { 0.5f, 0.400000006f, 0.300000012f, 0.235294119f,
125 0.192307696f, 0.16216217f, 0.140000001f, 0.123076923f });
128 struct FloatNchwLocalBrightnessWithinNormalizationFixture : NormalizationFixture
130 FloatNchwLocalBrightnessWithinNormalizationFixture() : NormalizationFixture(
"[ 2, 1, 2, 2 ]",
"[ 2, 1, 2, 2 ]",
131 "Float32",
"1",
"0",
"NCHW") {}
136 RunTest<4, armnn::DataType::Float32>(0, { 1.0f, 2.0f, 3.0f, 4.0f,
137 5.0f, 6.0f, 7.0f, 8.0f },
138 { 0.0322581f, 0.0645161f, 0.0967742f, 0.1290323f,
139 0.0285714f, 0.0342857f, 0.04f, 0.0457143f });
void SetupSingleInputSingleOutput(const std::string &inputName, const std::string &outputName)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
BOOST_FIXTURE_TEST_CASE(Float32NormalizationNhwcDataLayout, FloatNhwcLocalBrightnessAcrossNormalizationFixture)