aboutsummaryrefslogtreecommitdiff
path: root/src/backends/backendsCommon/test/layerTests/DepthToSpaceTestImpl.cpp
diff options
context:
space:
mode:
authorAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2019-10-01 18:35:44 +0100
committerAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2019-10-02 15:00:53 +0100
commitf97f6da835802187da03f597dcc30386c7b9b15b (patch)
treec936cb6f4c38e19f39bfc935aadff0219d6a38b8 /src/backends/backendsCommon/test/layerTests/DepthToSpaceTestImpl.cpp
parent680f9911d9d9b369fe321ee2dad014012fb5b20f (diff)
downloadarmnn-f97f6da835802187da03f597dcc30386c7b9b15b.tar.gz
IVGCVSW-3738 Add end-to-end layer test for DepthToSpace
* Added end-to-end layer test implementation for DepthToSpace * Added test to reference, CL and NEON backends for all supported data types and data layouts * Extracted common data permutation code into new utility file and refactored some existing tests to reduce code duplication * Fixed EndToEndLayerTestImpl template to work with Float16 data Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> Change-Id: Iaf7a0012c520451052b20c37e36dc05fa8314ff6
Diffstat (limited to 'src/backends/backendsCommon/test/layerTests/DepthToSpaceTestImpl.cpp')
-rw-r--r--src/backends/backendsCommon/test/layerTests/DepthToSpaceTestImpl.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/backends/backendsCommon/test/layerTests/DepthToSpaceTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/DepthToSpaceTestImpl.cpp
index 9588f560ef..e21a4b64f8 100644
--- a/src/backends/backendsCommon/test/layerTests/DepthToSpaceTestImpl.cpp
+++ b/src/backends/backendsCommon/test/layerTests/DepthToSpaceTestImpl.cpp
@@ -9,6 +9,7 @@
#include <armnn/ArmNN.hpp>
+#include <backendsCommon/test/DataLayoutUtils.hpp>
#include <backendsCommon/test/TensorCopyUtils.hpp>
#include <backendsCommon/test/WorkloadTestUtils.hpp>
@@ -29,22 +30,10 @@ LayerTestResult<T, 4> DepthToSpaceTestImpl(
const float qScale = 1.0f,
const int32_t qOffset = 0)
{
- const armnn::PermutationVector permVector{0, 2, 3, 1};
-
if (descriptor.m_Parameters.m_DataLayout == armnn::DataLayout::NCHW)
{
- inputInfo = armnnUtils::Permuted(inputInfo, permVector);
- outputInfo = armnnUtils::Permuted(outputInfo, permVector);
-
- constexpr size_t typeSize = sizeof(float);
-
- std::vector<float> inputTmp(inputData.size());
- armnnUtils::Permute(inputInfo.GetShape(), permVector, inputData.data(), inputTmp.data(), typeSize);
- inputData = inputTmp;
-
- std::vector<float> outputTmp(expectedOutputData.size());
- armnnUtils::Permute(outputInfo.GetShape(), permVector, expectedOutputData.data(), outputTmp.data(), typeSize);
- expectedOutputData = outputTmp;
+ PermuteTensorNhwcToNchw<float>(inputInfo, inputData);
+ PermuteTensorNhwcToNchw<float>(outputInfo, expectedOutputData);
}
if(armnn::IsQuantizedType<T>())