diff options
Diffstat (limited to 'src/backends/tosaReference/test')
-rw-r--r-- | src/backends/tosaReference/test/TosaRefEndToEndTests.cpp | 14 | ||||
-rw-r--r-- | src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp | 51 |
2 files changed, 62 insertions, 3 deletions
diff --git a/src/backends/tosaReference/test/TosaRefEndToEndTests.cpp b/src/backends/tosaReference/test/TosaRefEndToEndTests.cpp index 2f1231013a..00c0386b51 100644 --- a/src/backends/tosaReference/test/TosaRefEndToEndTests.cpp +++ b/src/backends/tosaReference/test/TosaRefEndToEndTests.cpp @@ -10,6 +10,7 @@ #include "backendsCommon/test/Pooling2dEndToEndTestImpl.hpp" #include "backendsCommon/test/ReshapeEndToEndTestImpl.hpp" #include "backendsCommon/test/SliceEndToEndTestImpl.hpp" +#include "backendsCommon/test/TransposeConvolution2dEndToEndTestImpl.hpp" #include <doctest/doctest.h> @@ -108,4 +109,17 @@ TEST_CASE("TosaRefSliceEndtoEndTestFloat16") SliceEndToEndFloat16<DataType::Float16>(tosaDefaultBackends); } +// TransposeConvolution2d +TEST_CASE("TosaRefTransposeConvolution2dEndToEndFloatNhwcTest") +{ + TransposeConvolution2dEndToEnd<armnn::DataType::Float32, armnn::DataType::Float32>( + tosaDefaultBackends, armnn::DataLayout::NHWC); +} + +TEST_CASE("TosaRefSimpleTransposeConvolution2dEndToEndFloatNhwcTest") +{ + SimpleTransposeConvolution2dEndToEnd<armnn::DataType::Float32, armnn::DataType::Float32>( + tosaDefaultBackends, armnn::DataLayout::NHWC); +} + }
\ No newline at end of file diff --git a/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp b/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp index 0d0cd6eefc..3c3abc2af3 100644 --- a/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp +++ b/src/backends/tosaReference/test/TosaRefLayerSupportTests.cpp @@ -105,7 +105,7 @@ TEST_CASE("IsLayerSupportedTosaReferenceConv2d") TosaRefLayerSupport supportChecker; std::string reasonIfNotSupported; - auto supported = supportChecker.IsLayerSupported(armnn::LayerType::Convolution2d, + auto supported = supportChecker.IsLayerSupported(LayerType::Convolution2d, {inputInfo, outputInfo, weightsInfo, biasesInfo}, desc, EmptyOptional(), @@ -128,7 +128,7 @@ TEST_CASE("IsLayerSupportedTosaReferenceConv2dUnsupported") TosaRefLayerSupport supportChecker; std::string reasonIfNotSupported; - auto supported = supportChecker.IsLayerSupported(armnn::LayerType::Convolution2d, + auto supported = supportChecker.IsLayerSupported(LayerType::Convolution2d, {inputInfo, outputInfo, weightsInfo, biasesInfo}, desc, EmptyOptional(), @@ -150,7 +150,7 @@ TEST_CASE("IsLayerSupportedTosaReferenceMaxPooling2d") desc.m_PoolWidth = 1; desc.m_StrideX = 1; desc.m_StrideY = 1; - desc.m_PoolType = armnn::PoolingAlgorithm::Max; + desc.m_PoolType = PoolingAlgorithm::Max; TosaRefLayerSupport supportChecker; std::string reasonIfNotSupported; @@ -324,4 +324,49 @@ TEST_CASE("IsLayerSupportedTosaReferenceSliceUnsupported") CHECK(!supported); } +TEST_CASE("IsLayerSupportedTosaReferenceTransposeConv2d") +{ + TensorInfo inputInfo ({ 1, 3, 3, 1 }, DataType::Float32); + TensorInfo outputInfo({ 1, 5, 5, 1 }, DataType::Float32); + TensorInfo weightsInfo({ 1, 3, 3, 1 }, DataType::Float32); + TensorInfo biasesInfo ({ 1 }, DataType::Float32); + + TransposeConvolution2dDescriptor desc; + desc.m_StrideX = 1; + desc.m_StrideY = 1; + desc.m_BiasEnabled = true; + + TosaRefLayerSupport supportChecker; + std::string reasonIfNotSupported; + auto supported = supportChecker.IsLayerSupported(LayerType::TransposeConvolution2d, + {inputInfo, outputInfo, weightsInfo, biasesInfo}, + desc, + EmptyOptional(), + EmptyOptional(), + reasonIfNotSupported); + CHECK(supported); +} + +TEST_CASE("IsLayerSupportedTosaReferenceTransposeConv2dUnsupported") +{ + // If inputs and weights are Fp32, output must match. + TensorInfo inputInfo ({ 1, 3, 3, 1 }, DataType::Float32); + TensorInfo outputInfo({ 1, 5, 5, 1 }, DataType::Float32); + TensorInfo weightsInfo({ 1, 3, 3, 1 }, DataType::Float32, 0.0f, 0, true); + TensorInfo biasesInfo ({ 1 }, DataType::Float32, 0.0f, 0, true); + + TransposeConvolution2dDescriptor desc; + desc.m_BiasEnabled = true; + + TosaRefLayerSupport supportChecker; + std::string reasonIfNotSupported; + auto supported = supportChecker.IsLayerSupported(LayerType::TransposeConvolution2d, + {inputInfo, outputInfo, weightsInfo, biasesInfo}, + desc, + EmptyOptional(), + EmptyOptional(), + reasonIfNotSupported); + CHECK(!supported); +} + } |