diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/armnnDeserializer/Deserializer.cpp | 5 | ||||
-rw-r--r-- | src/armnnDeserializer/test/DeserializePooling2d.cpp | 23 |
2 files changed, 21 insertions, 7 deletions
diff --git a/src/armnnDeserializer/Deserializer.cpp b/src/armnnDeserializer/Deserializer.cpp index 9b4cbe9439..8f2fa3f150 100644 --- a/src/armnnDeserializer/Deserializer.cpp +++ b/src/armnnDeserializer/Deserializer.cpp @@ -1956,6 +1956,11 @@ armnn::Pooling2dDescriptor IDeserializer::DeserializerImpl::GetPoolingDescriptor desc.m_PoolType = armnn::PoolingAlgorithm::Max; break; } + case PoolingAlgorithm_L2: + { + desc.m_PoolType = armnn::PoolingAlgorithm::L2; + break; + } default: { ARMNN_ASSERT_MSG(false, "Unsupported pooling algorithm"); diff --git a/src/armnnDeserializer/test/DeserializePooling2d.cpp b/src/armnnDeserializer/test/DeserializePooling2d.cpp index 4d75740475..bf7b8ae8d4 100644 --- a/src/armnnDeserializer/test/DeserializePooling2d.cpp +++ b/src/armnnDeserializer/test/DeserializePooling2d.cpp @@ -108,7 +108,8 @@ struct Pooling2dFixture : public ParserFlatbuffersSerializeFixture struct SimpleAvgPooling2dFixture : Pooling2dFixture { - SimpleAvgPooling2dFixture() : Pooling2dFixture("[ 1, 2, 2, 1 ]", "[ 1, 1, 1, 1 ]", + SimpleAvgPooling2dFixture() : Pooling2dFixture("[ 1, 2, 2, 1 ]", + "[ 1, 1, 1, 1 ]", "Float32", "NHWC", "Average") {} }; @@ -133,6 +134,13 @@ struct SimpleMaxPooling2dFixture2 : Pooling2dFixture "QuantisedAsymm8", "NCHW", "Max") {} }; +struct SimpleL2Pooling2dFixture : Pooling2dFixture +{ + SimpleL2Pooling2dFixture() : Pooling2dFixture("[ 1, 2, 2, 1 ]", + "[ 1, 1, 1, 1 ]", + "Float32", "NHWC", "L2") {} +}; + BOOST_FIXTURE_TEST_CASE(Pooling2dFloat32Avg, SimpleAvgPooling2dFixture) { RunTest<4, armnn::DataType::Float32>(0, { 2, 3, 5, 2 }, { 3 }); @@ -140,9 +148,7 @@ BOOST_FIXTURE_TEST_CASE(Pooling2dFloat32Avg, SimpleAvgPooling2dFixture) BOOST_FIXTURE_TEST_CASE(Pooling2dQuantisedAsymm8Avg, SimpleAvgPooling2dFixture2) { - RunTest<4, armnn::DataType::QAsymmU8>(0, - { 20, 40, 60, 80 }, - { 50 }); + RunTest<4, armnn::DataType::QAsymmU8>(0,{ 20, 40, 60, 80 },{ 50 }); } BOOST_FIXTURE_TEST_CASE(Pooling2dFloat32Max, SimpleMaxPooling2dFixture) @@ -152,9 +158,12 @@ BOOST_FIXTURE_TEST_CASE(Pooling2dFloat32Max, SimpleMaxPooling2dFixture) BOOST_FIXTURE_TEST_CASE(Pooling2dQuantisedAsymm8Max, SimpleMaxPooling2dFixture2) { - RunTest<4, armnn::DataType::QAsymmU8>(0, - { 20, 40, 60, 80 }, - { 80 }); + RunTest<4, armnn::DataType::QAsymmU8>(0,{ 20, 40, 60, 80 },{ 80 }); +} + +BOOST_FIXTURE_TEST_CASE(Pooling2dFloat32L2, SimpleL2Pooling2dFixture) +{ + RunTest<4, armnn::DataType::Float32>(0, { 2, 3, 5, 2 }, { 3.2403703f }); } BOOST_AUTO_TEST_SUITE_END() |