From cf22ca9d9121666f985eb7d130aac03233902007 Mon Sep 17 00:00:00 2001 From: Mohamed Nour Abouelseoud Date: Mon, 10 Dec 2018 14:19:41 +0000 Subject: [PATCH] IVGCVSW-2354 Remove dimension validation from softmax Change-Id: I0d69a72df9e348cbeca690926485c050499d1051 --- src/backends/cl/test/ClLayerTests.cpp | 15 --------------- src/backends/cl/workloads/ClSoftmaxBaseWorkload.cpp | 6 ------ src/backends/neon/test/NeonLayerTests.cpp | 15 --------------- src/backends/neon/workloads/NeonSoftmaxBaseWorkload.cpp | 6 ------ 4 files changed, 42 deletions(-) diff --git a/src/backends/cl/test/ClLayerTests.cpp b/src/backends/cl/test/ClLayerTests.cpp index 862648e..10c177c 100755 --- a/src/backends/cl/test/ClLayerTests.cpp +++ b/src/backends/cl/test/ClLayerTests.cpp @@ -121,21 +121,6 @@ ARMNN_AUTO_TEST_CASE(DepthwiseConvolution2dAsymmetricNhwc, ARMNN_AUTO_TEST_CASE(UnbiasedDepthwiseConvolution2dAsymmetricNhwc, DepthwiseConvolution2dAsymmetricTest, false, armnn::DataLayout::NHWC) -// Softmax -BOOST_AUTO_TEST_CASE(Softmax4dSupport) -{ - const unsigned int numDimensions = 4u; - std::array dimensionSizes; - dimensionSizes.fill(1u); - - const armnn::TensorInfo inputInfo(numDimensions, &dimensionSizes.front(), armnn::DataType::Float32); - const armnn::TensorInfo outputInfo(numDimensions, &dimensionSizes.front(), armnn::DataType::Float32); - - // 4D Softmax should be reported as unsupported on the CL backend - armnn::ClLayerSupport layerSupport; - BOOST_TEST(!layerSupport.IsSoftmaxSupported(inputInfo, outputInfo, armnn::SoftmaxDescriptor())); -} - // Splitter ARMNN_AUTO_TEST_CASE(SimpleSplitter, SplitterTest) ARMNN_AUTO_TEST_CASE(SimpleSplitterUint8, SplitterUint8Test) diff --git a/src/backends/cl/workloads/ClSoftmaxBaseWorkload.cpp b/src/backends/cl/workloads/ClSoftmaxBaseWorkload.cpp index 48dd398..b1dc404 100644 --- a/src/backends/cl/workloads/ClSoftmaxBaseWorkload.cpp +++ b/src/backends/cl/workloads/ClSoftmaxBaseWorkload.cpp @@ -15,12 +15,6 @@ namespace armnn arm_compute::Status ClSoftmaxWorkloadValidate(const TensorInfo& input, const TensorInfo& output) { - // NOTE: We report 4D Softmax as unsupported until full support is added to ACL - if(input.GetShape().GetNumDimensions() >= 4u) - { - return arm_compute::Status(arm_compute::ErrorCode::RUNTIME_ERROR, "4d softmax is not supported"); - } - const arm_compute::TensorInfo aclInputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(input); const arm_compute::TensorInfo aclOutputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(output); diff --git a/src/backends/neon/test/NeonLayerTests.cpp b/src/backends/neon/test/NeonLayerTests.cpp index 0382c1c..72ae372 100644 --- a/src/backends/neon/test/NeonLayerTests.cpp +++ b/src/backends/neon/test/NeonLayerTests.cpp @@ -282,21 +282,6 @@ ARMNN_AUTO_TEST_CASE(SimpleSoftmaxBeta2Uint8, SimpleSoftmaxUint8Test, 2.0f) ARMNN_AUTO_TEST_CASE(ReLu1Uint8, BoundedReLuUint8UpperAndLowerBoundTest) ARMNN_AUTO_TEST_CASE(ReLu6Uint8, BoundedReLuUint8UpperBoundOnlyTest) -// Softmax -BOOST_AUTO_TEST_CASE(Softmax4dSupport) -{ - const unsigned int numDimensions = 4u; - std::array dimensionSizes; - dimensionSizes.fill(1u); - - const armnn::TensorInfo inputInfo(numDimensions, &dimensionSizes.front(), armnn::DataType::Float32); - const armnn::TensorInfo outputInfo(numDimensions, &dimensionSizes.front(), armnn::DataType::Float32); - - // 4D Softmax should be reported as unsupported on the NEON backend - armnn::NeonLayerSupport layerSupport; - BOOST_TEST(!layerSupport.IsSoftmaxSupported(inputInfo, outputInfo, armnn::SoftmaxDescriptor())); -} - // Splitter ARMNN_AUTO_TEST_CASE(SimpleSplitter, SplitterTest) ARMNN_AUTO_TEST_CASE(SimpleSplitterUint8, SplitterUint8Test) diff --git a/src/backends/neon/workloads/NeonSoftmaxBaseWorkload.cpp b/src/backends/neon/workloads/NeonSoftmaxBaseWorkload.cpp index b97cf84..434de87 100644 --- a/src/backends/neon/workloads/NeonSoftmaxBaseWorkload.cpp +++ b/src/backends/neon/workloads/NeonSoftmaxBaseWorkload.cpp @@ -14,12 +14,6 @@ arm_compute::Status NeonSoftmaxWorkloadValidate(const TensorInfo& input, const TensorInfo& output, const SoftmaxDescriptor& descriptor) { - // NOTE: We report 4D Softmax as unsupported until full support is added to ACL - if(input.GetShape().GetNumDimensions() >= 4u) - { - return arm_compute::Status(arm_compute::ErrorCode::RUNTIME_ERROR, "4d softmax is not supported"); - } - const arm_compute::TensorInfo aclInputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(input); const arm_compute::TensorInfo aclOutputInfo = armcomputetensorutils::BuildArmComputeTensorInfo(output); -- 2.7.4