ArmNN  NotReleased
DeserializeL2Normalization.cpp File Reference
#include <boost/test/unit_test.hpp>
#include "ParserFlatbuffersSerializeFixture.hpp"
#include "../Deserializer.hpp"
#include <string>
#include <iostream>

Go to the source code of this file.

Functions

 BOOST_FIXTURE_TEST_CASE (L2NormalizationFloat32, L2NormFixture)
 
 BOOST_FIXTURE_TEST_CASE (L2NormalizationEpsilonLimitFloat32, L2NormFixture)
 

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE() [1/2]

BOOST_FIXTURE_TEST_CASE ( L2NormalizationFloat32  ,
L2NormFixture   
)

Definition at line 118 of file DeserializeL2Normalization.cpp.

119 {
120  // 1 / sqrt(1^2 + 2^2 + 3^2)
121  const float approxInvL2Norm = 0.267261f;
122 
123  RunTest<4, armnn::DataType::Float32>(0,
124  {{"InputLayer", { 1.0f, 2.0f, 3.0f }}},
125  {{"OutputLayer",{ 1.0f * approxInvL2Norm,
126  2.0f * approxInvL2Norm,
127  3.0f * approxInvL2Norm }}});
128 }

◆ BOOST_FIXTURE_TEST_CASE() [2/2]

BOOST_FIXTURE_TEST_CASE ( L2NormalizationEpsilonLimitFloat32  ,
L2NormFixture   
)

Definition at line 130 of file DeserializeL2Normalization.cpp.

References BOOST_AUTO_TEST_SUITE_END().

131 {
132  // 1 / sqrt(1e-8)
133  const float approxInvL2Norm = 10000;
134 
135  RunTest<4, armnn::DataType::Float32>(0,
136  {{"InputLayer", { 0.00000001f, 0.00000002f, 0.00000003f }}},
137  {{"OutputLayer",{ 0.00000001f * approxInvL2Norm,
138  0.00000002f * approxInvL2Norm,
139  0.00000003f * approxInvL2Norm }}});
140 }