15 explicit L2NormalizationFixture(
const std::string &inputShape,
16 const std::string &outputShape,
17 const std::string &dataType,
18 const std::string &dataLayout,
19 const std::string epsilon)
27 layer_type: "InputLayer", 33 layerName: "InputLayer", 37 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 42 dimensions: )" + inputShape + R"(, 43 dataType: ")" + dataType + R"(", 44 quantizationScale: 0.5, 53 layer_type: "L2NormalizationLayer", 57 layerName: "L2NormalizationLayer", 58 layerType: "L2Normalization", 61 connection: {sourceLayerIndex:0, outputSlotIndex:0 }, 66 dimensions: )" + outputShape + R"(, 67 dataType: ")" + dataType + R"(" 72 dataLayout: ")" + dataLayout + R"(", 73 eps: )" + epsilon + R"( 78 layer_type: "OutputLayer", 84 layerName: "OutputLayer", 88 connection: {sourceLayerIndex:1, outputSlotIndex:0 }, 93 dimensions: )" + outputShape + R"(, 94 dataType: ")" + dataType + R"(" 106 struct L2NormFixture : L2NormalizationFixture
109 L2NormFixture():L2NormalizationFixture(
"[ 1, 3, 1, 1 ]",
119 const float approxInvL2Norm = 0.267261f;
121 RunTest<4, armnn::DataType::Float32>(0,
122 {{
"InputLayer", { 1.0f, 2.0f, 3.0f }}},
123 {{
"OutputLayer",{ 1.0f * approxInvL2Norm,
124 2.0f * approxInvL2Norm,
125 3.0f * approxInvL2Norm }}});
131 const float approxInvL2Norm = 10000;
133 RunTest<4, armnn::DataType::Float32>(0,
134 {{
"InputLayer", { 0.00000001f, 0.00000002f, 0.00000003f }}},
135 {{
"OutputLayer",{ 0.00000001f * approxInvL2Norm,
136 0.00000002f * approxInvL2Norm,
137 0.00000003f * approxInvL2Norm }}});
TEST_SUITE("Deserializer_L2Normalization")
TEST_CASE_FIXTURE(ClContextControlFixture, "CopyBetweenNeonAndGpu")