From dd6aceaa884815e68ed69fca71de81babd3204da Mon Sep 17 00:00:00 2001 From: Mohamed Nour Abouelseoud Date: Thu, 18 Oct 2018 12:26:19 +0100 Subject: IVGCVSW-2013 Add a UInt8 Reference Implementation for the PAD Operator Change-Id: I41f3606198db1fda8d72aaf5169594ba9156eb38 --- src/backends/test/LayerTests.cpp | 577 ++++++++++++++++++++------------------- 1 file changed, 293 insertions(+), 284 deletions(-) (limited to 'src/backends/test/LayerTests.cpp') diff --git a/src/backends/test/LayerTests.cpp b/src/backends/test/LayerTests.cpp index 95f2a32297..e762152b67 100755 --- a/src/backends/test/LayerTests.cpp +++ b/src/backends/test/LayerTests.cpp @@ -3441,123 +3441,120 @@ float CalcInvL2Norm(std::initializer_list elements) } // anonymous namespace -LayerTestResult Pad2dTest(armnn::IWorkloadFactory& workloadFactory) +template +LayerTestResult Pad2dTestCommon(armnn::IWorkloadFactory& workloadFactory, float qScale, int32_t qOffset) { - const armnn::TensorShape inputShape{ 3, 3 }; - const armnn::TensorShape outputShape{ 7, 7 }; - - const armnn::TensorInfo inputTensorInfo(inputShape, armnn::DataType::Float32); - const armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32); + const armnn::TensorShape inputShape{ 3, 3 }; + const armnn::TensorShape outputShape{ 7, 7 }; + const armnn::TensorInfo inputTensorInfo(inputShape, armnn::GetDataType()); + const armnn::TensorInfo outputTensorInfo(outputShape, armnn::GetDataType()); - std::vector inputValues + std::vector inputValues( + QuantizedVector(qScale, qOffset, { + // Height (3) x Width (3) + 4, 8, 6, + 7, 4, 4, + 3, 2, 4 + })); - // Height (3) x Width (3) - 4.0f, 8.0f, 6.0f, - 7.0f, 4.0f, 4.0f, - 3.0f, 2.0f, 4.0f - - }; - - std::vector expectedOutputValues + std::vector 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 + })); - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 4.0f, 8.0f, 6.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 7.0f, 4.0f, 4.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 3.0f, 2.0f, 4.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f - - }; - - auto inputTensor = MakeTensor(inputTensorInfo, std::vector(inputValues)); + auto inputTensor = MakeTensor(inputTensorInfo, std::vector(inputValues)); - LayerTestResult result(outputTensorInfo); - result.outputExpected = MakeTensor(outputTensorInfo, std::vector(expectedOutputValues)); + LayerTestResult result(outputTensorInfo); + result.outputExpected = MakeTensor(outputTensorInfo, std::vector(expectedOutputValues)); - std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); - std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); + std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); + std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); - armnn::PadQueueDescriptor descriptor; + 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; - armnn::WorkloadInfo info; + descriptor.m_Parameters.m_PadList = PadList; + armnn::WorkloadInfo info; - AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); - AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); + AddInputToWorkload(descriptor, info, inputTensorInfo, inputHandle.get()); + AddOutputToWorkload(descriptor, info, outputTensorInfo, outputHandle.get()); - std::unique_ptr workload = workloadFactory.CreatePad(descriptor, info); + std::unique_ptr workload = workloadFactory.CreatePad(descriptor, info); - inputHandle->Allocate(); - outputHandle->Allocate(); + inputHandle->Allocate(); + outputHandle->Allocate(); - CopyDataToITensorHandle(inputHandle.get(), &inputTensor[0][0]); + CopyDataToITensorHandle(inputHandle.get(), &inputTensor[0][0]); - workloadFactory.Finalize(); - workload->Execute(); + workloadFactory.Finalize(); + workload->Execute(); - CopyDataFromITensorHandle(&result.output[0][0], outputHandle.get()); + CopyDataFromITensorHandle(&result.output[0][0], outputHandle.get()); - return result; -}; + return result; +} -LayerTestResult Pad3dTest(armnn::IWorkloadFactory& workloadFactory) +template +LayerTestResult Pad3dTestCommon(armnn::IWorkloadFactory& workloadFactory, float qScale, int32_t qOffset) { const armnn::TensorShape inputShape{ 2, 2, 2 }; const armnn::TensorShape outputShape{ 3, 5, 6 }; - const armnn::TensorInfo inputTensorInfo(inputShape, armnn::DataType::Float32); - const armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32); - + const armnn::TensorInfo inputTensorInfo(inputShape, armnn::GetDataType()); + const armnn::TensorInfo outputTensorInfo(outputShape, armnn::GetDataType()); - std::vector inputValues + std::vector inputValues( + QuantizedVector(qScale,qOffset, { - // Channel 0, Height (2) x Width (2) - 0.0f, 4.0f, - 2.0f, 5.0f, + 0, 4, + 2, 5, // Channel 1, Height (2) x Width (2) - 6.0f, 1.0f, - 5.0f, 2.0f - }; + 6, 1, + 5, 2 + })); - std::vector expectedOutputValues + std::vector expectedOutputValues( + QuantizedVector(qScale,qOffset, { - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 4.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 2.0f, 5.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 4, 0, 0, + 0, 0, 2, 5, 0, 0, + 0, 0, 0, 0, 0, 0, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 6.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 5.0f, 2.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 6, 1, 0, 0, + 0, 0, 5, 2, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f - - }; + })); - auto inputTensor = MakeTensor(inputTensorInfo, std::vector(inputValues)); + auto inputTensor = MakeTensor(inputTensorInfo, std::vector(inputValues)); - LayerTestResult result(outputTensorInfo); - result.outputExpected = MakeTensor(outputTensorInfo, std::vector(expectedOutputValues)); + LayerTestResult result(outputTensorInfo); + result.outputExpected = MakeTensor(outputTensorInfo, std::vector(expectedOutputValues)); std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); @@ -3588,227 +3585,209 @@ LayerTestResult Pad3dTest(armnn::IWorkloadFactory& workloadFactory) CopyDataFromITensorHandle(&result.output[0][0][0], outputHandle.get()); return result; -}; +} -LayerTestResult Pad4dTest(armnn::IWorkloadFactory& workloadFactory) +template +LayerTestResult Pad4dTestCommon(armnn::IWorkloadFactory& workloadFactory, float qScale, int32_t qOffset) { const armnn::TensorShape inputShape{ 2, 2, 3, 2 }; const armnn::TensorShape outputShape{ 4, 5, 7, 4 }; - const armnn::TensorInfo inputTensorInfo(inputShape, armnn::DataType::Float32); - const armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32); + const armnn::TensorInfo inputTensorInfo(inputShape, armnn::GetDataType()); + const armnn::TensorInfo outputTensorInfo(outputShape, armnn::GetDataType()); - std::vector inputValues + std::vector inputValues( + QuantizedVector(qScale,qOffset, { // Batch 0, Channel 0, Height (3) x Width (2) - 0.0f, 1.0f, - 2.0f, 3.0f, - 4.0f, 5.0f, + 0, 1, + 2, 3, + 4, 5, // Batch 0, Channel 1, Height (3) x Width (2) - 6.0f, 7.0f, - 8.0f, 9.0f, - 10.0f, 11.0f, + 6, 7, + 8, 9, + 10, 11, // Batch 1, Channel 0, Height (3) x Width (2) - 12.0f, 13.0f, - 14.0f, 15.0f, - 16.0f, 17.0f, + 12, 13, + 14, 15, + 16, 17, // Batch 1, Channel 1, Height (3) x Width (2) - 18.0f, 19.0f, - 20.0f, 21.0f, - 22.0f, 23.0f - - }; + 18, 19, + 20, 21, + 22, 23 + })); - std::vector expectedOutputValues + std::vector expectedOutputValues( + QuantizedVector(qScale,qOffset, { - 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, - - - 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 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10, 11, 0, + 0, 0, 0, 0, + + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 12, 13, 0, + 0, 14, 15, 0, + 0, 16, 17, 0, + 0, 0, 0, 0, + + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 18, 19, 0, + 0, 20, 21, 0, + 0, 22, 23, 0, + 0, 0, 0, 0, + + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0 + })); - }; + auto inputTensor = MakeTensor(inputTensorInfo, std::vector(inputValues)); - auto inputTensor = MakeTensor(inputTensorInfo, std::vector(inputValues)); - - LayerTestResult result(outputTensorInfo); - result.outputExpected = MakeTensor(outputTensorInfo, std::vector(expectedOutputValues)); + LayerTestResult result(outputTensorInfo); + result.outputExpected = MakeTensor(outputTensorInfo, std::vector(expectedOutputValues)); std::unique_ptr inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); std::unique_ptr outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); @@ -3841,7 +3820,37 @@ LayerTestResult Pad4dTest(armnn::IWorkloadFactory& workloadFactory) CopyDataFromITensorHandle(&result.output[0][0][0][0], outputHandle.get()); return result; -}; +} + +LayerTestResult PadUint82dTest(armnn::IWorkloadFactory& workloadFactory) +{ + return Pad2dTestCommon(workloadFactory, 1.0f, 0); +} + +LayerTestResult PadUint83dTest(armnn::IWorkloadFactory& workloadFactory) +{ + return Pad3dTestCommon(workloadFactory, 1.0f, 0); +} + +LayerTestResult PadUint84dTest(armnn::IWorkloadFactory& workloadFactory) +{ + return Pad4dTestCommon(workloadFactory, 1.0f, 0); +} + +LayerTestResult PadFloat322dTest(armnn::IWorkloadFactory& workloadFactory) +{ + return Pad2dTestCommon(workloadFactory, 0.0f, 0); +} + +LayerTestResult PadFloat323dTest(armnn::IWorkloadFactory& workloadFactory) +{ + return Pad3dTestCommon(workloadFactory, 0.0f, 0); +} + +LayerTestResult PadFloat324dTest(armnn::IWorkloadFactory& workloadFactory) +{ + return Pad4dTestCommon(workloadFactory, 0.0f, 0); +} LayerTestResult L2Normalization1dTest(armnn::IWorkloadFactory& workloadFactory) { -- cgit v1.2.1