From: Teresa Charlin Date: Tue, 2 Jul 2019 15:24:09 +0000 (+0100) Subject: IVGCVSW-3393 Fix Ref Unit test for customizable padding value X-Git-Tag: submit/tizen/20200316.035456~468 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec8e198a00d9af1aa02c77709b3c452eb09bb541;p=platform%2Fupstream%2Farmnn.git IVGCVSW-3393 Fix Ref Unit test for customizable padding value Add Neon missing Unit Test for Uint8. Signed-off-by: Teresa Charlin Change-Id: I9207be8c8cf572ae9cbbf155010bb6dabe0c971c --- diff --git a/src/backends/backendsCommon/test/LayerTests.cpp b/src/backends/backendsCommon/test/LayerTests.cpp index 5c41d3a..57fcfbb 100644 --- a/src/backends/backendsCommon/test/LayerTests.cpp +++ b/src/backends/backendsCommon/test/LayerTests.cpp @@ -6054,38 +6054,19 @@ LayerTestResult Pad2dTestCommon( 3, 2, 4 })); - const T padValue = ConvertToDataType(customPaddingValue, inputTensorInfo); - + auto p = customPaddingValue; std::vector expectedOutputValues; - if (padValue == 0) - { - expectedOutputValues = ( - QuantizedVector(qScale, qOffset, - { - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 4, 8, 6, 0, 0, - 0, 0, 7, 4, 4, 0, 0, - 0, 0, 3, 2, 4, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0 - })); - } - else + expectedOutputValues = ( + QuantizedVector(qScale, qOffset, { - expectedOutputValues = ( - QuantizedVector(qScale, qOffset, - { - 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, - 1, 1, 4, 8, 6, 1, 1, - 1, 1, 7, 4, 4, 1, 1, - 1, 1, 3, 2, 4, 1, 1, - 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1 - })); - } - + p, p, p, p, p, p, p, + p, p, p, p, p, p, p, + p, p, 4, 8, 6, p, p, + p, p, 7, 4, 4, p, p, + p, p, 3, 2, 4, p, p, + p, p, p, p, p, p, p, + p, p, p, p, p, p, p + })); auto inputTensor = MakeTensor(inputTensorInfo, std::vector(inputValues)); @@ -6097,11 +6078,12 @@ LayerTestResult Pad2dTestCommon( armnn::PadQueueDescriptor descriptor; - std::vector> PadList; - PadList.push_back(std::pair(2,2)); - PadList.push_back(std::pair(2,2)); + std::vector> padList; + padList.push_back(std::pair(2,2)); + padList.push_back(std::pair(2,2)); - descriptor.m_Parameters.m_PadList = PadList; + descriptor.m_Parameters.m_PadList = padList; + descriptor.m_Parameters.m_PadValue = customPaddingValue; armnn::WorkloadInfo info; AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); @@ -6449,56 +6431,56 @@ LayerTestResult PadUint82dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) { - return Pad2dTestCommon(workloadFactory, memoryManager, 1.0f, 0); + return Pad2dTestCommon(workloadFactory, memoryManager, 1.0f, 0); } LayerTestResult PadUint82dCustomPaddingTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) { - return Pad2dTestCommon(workloadFactory, memoryManager, 1.0f, 0); + return Pad2dTestCommon(workloadFactory, memoryManager, 1.0f, 0, 1); } LayerTestResult PadUint83dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) { - return Pad3dTestCommon(workloadFactory, memoryManager, 1.0f, 0); + return Pad3dTestCommon(workloadFactory, memoryManager, 1.0f, 0); } LayerTestResult PadUint84dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) { - return Pad4dTestCommon(workloadFactory, memoryManager, 1.0f, 0); + return Pad4dTestCommon(workloadFactory, memoryManager, 1.0f, 0); } LayerTestResult PadFloat322dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) { - return Pad2dTestCommon(workloadFactory, memoryManager, 0.0f, 0); + return Pad2dTestCommon(workloadFactory, memoryManager, 0.0f, 0); } LayerTestResult PadFloat322dCustomPaddingTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) { - return Pad2dTestCommon(workloadFactory, memoryManager, 0.0f, 0); + return Pad2dTestCommon(workloadFactory, memoryManager, 0.0f, 0, 1); } LayerTestResult PadFloat323dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) { - return Pad3dTestCommon(workloadFactory, memoryManager, 0.0f, 0); + return Pad3dTestCommon(workloadFactory, memoryManager, 0.0f, 0); } LayerTestResult PadFloat324dTest( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) { - return Pad4dTestCommon(workloadFactory, memoryManager, 0.0f, 0); + return Pad4dTestCommon(workloadFactory, memoryManager, 0.0f, 0); } template> @@ -9416,7 +9398,6 @@ LayerTestResult SpaceToBatchNdPaddingNHWCUint16Test( return SpaceToBatchNdPaddingNHWCTest(workloadFactory, memoryManager); } - LayerTestResult SpaceToDepthNHWCAsymmQ8Test( armnn::IWorkloadFactory& workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) diff --git a/src/backends/neon/test/NeonLayerTests.cpp b/src/backends/neon/test/NeonLayerTests.cpp index 8da54a7..77413bd 100644 --- a/src/backends/neon/test/NeonLayerTests.cpp +++ b/src/backends/neon/test/NeonLayerTests.cpp @@ -427,6 +427,10 @@ ARMNN_AUTO_TEST_CASE(PadFloat322d, PadFloat322dTest) ARMNN_AUTO_TEST_CASE(PadFloat323d, PadFloat323dTest) ARMNN_AUTO_TEST_CASE(PadFloat324d, PadFloat324dTest) +ARMNN_AUTO_TEST_CASE(PadUint82d, PadUint82dTest) +ARMNN_AUTO_TEST_CASE(PadUint83d, PadUint83dTest) +ARMNN_AUTO_TEST_CASE(PadUint84d, PadUint84dTest) + // Permute ARMNN_AUTO_TEST_CASE(SimplePermuteFloat32, SimplePermuteFloat32Test) ARMNN_AUTO_TEST_CASE(SimplePermuteUint8, SimplePermuteUint8Test)