Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 1 | /* |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2019 ARM Limited. |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 22 | * SOFTWARE. |
| 23 | */ |
| 24 | #include "arm_compute/core/Types.h" |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 25 | #include "arm_compute/core/utils/misc/ShapeCalculator.h" |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 26 | #include "arm_compute/runtime/NEON/functions/NEDepthwiseConvolutionLayer.h" |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 27 | #include "arm_compute/runtime/Tensor.h" |
| 28 | #include "arm_compute/runtime/TensorAllocator.h" |
| 29 | #include "tests/NEON/Accessor.h" |
| 30 | #include "tests/PaddingCalculator.h" |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 31 | #include "tests/datasets/DepthwiseConvolutionLayerDataset.h" |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 32 | #include "tests/datasets/DilatedDepthwiseConvolutionLayerDataset.h" |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 33 | #include "tests/framework/Asserts.h" |
| 34 | #include "tests/framework/Macros.h" |
| 35 | #include "tests/framework/datasets/Datasets.h" |
| 36 | #include "tests/validation/Validation.h" |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 37 | #include "tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h" |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 38 | |
| 39 | namespace arm_compute |
| 40 | { |
| 41 | namespace test |
| 42 | { |
| 43 | namespace validation |
| 44 | { |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 45 | using namespace arm_compute::misc::shape_calculator; |
| 46 | |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 47 | namespace |
| 48 | { |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 49 | constexpr RelativeTolerance<float> tolerance_f32(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */ |
| 50 | constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1); /**< Tolerance value for comparing reference's output against implementation's output for DataType::QASYMM8 */ |
| 51 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
| 52 | RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.01)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */ |
| 53 | constexpr float tolerance_num = 0.05f; /**< Tolerance number */ |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 54 | #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 55 | |
| 56 | const auto depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 3 }); |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 57 | |
| 58 | //Activation Functions |
| 59 | const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo", |
| 60 | { |
| 61 | ActivationLayerInfo(), |
| 62 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) |
| 63 | }); |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 64 | } // namespace |
| 65 | |
| 66 | TEST_SUITE(NEON) |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 67 | TEST_SUITE(DepthwiseConvolutionLayer) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 68 | |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 69 | // *INDENT-OFF* |
| 70 | // clang-format off |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 71 | DATA_TEST_CASE(Validate3x3, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip( |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 72 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching data type input/weights |
| 73 | TensorInfo(TensorShape(32U, 18U, 3U), 1, DataType::F32), // Mismatching input feature maps |
| 74 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Unsupported weights dimensions |
| 75 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching depth multiplier |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 76 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::QASYMM8), // Invalid stride |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 77 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases size |
| 78 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases dimensions |
| 79 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid output size |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 80 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // patch size bigger than input width |
| 81 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // dilation < 1 |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 82 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 83 | }), |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 84 | framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16), |
| 85 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 86 | TensorInfo(TensorShape(5U, 5U, 2U, 2U), 1, DataType::F32), |
| 87 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 88 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::QASYMM8), |
| 89 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 90 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 91 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 92 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 93 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 94 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 95 | })), |
| 96 | framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 97 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 98 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 99 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 100 | TensorInfo(TensorShape(2U), 1, DataType::S32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 101 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
| 102 | TensorInfo(TensorShape(2U, 2U), 1, DataType::F32), |
| 103 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 104 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 105 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 106 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 107 | })), |
| 108 | framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 109 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 110 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 111 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 112 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::QASYMM8), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 113 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 114 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 115 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), |
| 116 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 117 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 118 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 119 | })), |
| 120 | framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0), |
| 121 | PadStrideInfo(1, 1, 0, 0), |
| 122 | PadStrideInfo(1, 1, 0, 0), |
| 123 | PadStrideInfo(1, 1, 0, 0), |
| 124 | PadStrideInfo(4, 1, 0, 0), |
| 125 | PadStrideInfo(1, 1, 0, 0), |
| 126 | PadStrideInfo(1, 1, 0, 0), |
| 127 | PadStrideInfo(1, 1, 0, 0), |
| 128 | PadStrideInfo(1, 1, 0, 0), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 129 | PadStrideInfo(1, 1, 0, 0), |
| 130 | PadStrideInfo(1, 1, 0, 0), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 131 | })), |
| 132 | framework::dataset::make("DepthMultiplier", { 1, |
| 133 | 1, |
| 134 | 1, |
| 135 | 3, |
| 136 | 1, |
| 137 | 1, |
| 138 | 1, |
| 139 | 1, |
| 140 | 1, |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 141 | 1, |
| 142 | 1, |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 143 | })), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 144 | framework::dataset::make("Dilation", { Size2D(1U, 1U), |
| 145 | Size2D(1U, 1U), |
| 146 | Size2D(1U, 1U), |
| 147 | Size2D(1U, 1U), |
| 148 | Size2D(1U, 1U), |
| 149 | Size2D(1U, 1U), |
| 150 | Size2D(1U, 1U), |
| 151 | Size2D(1U, 1U), |
| 152 | Size2D(25U, 1U), |
| 153 | Size2D(0U, 1U), |
| 154 | Size2D(1U, 1U), |
| 155 | })), |
| 156 | framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, false, false, true })), |
| 157 | input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 158 | { |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 159 | bool is_valid = bool(NEDepthwiseConvolutionLayer3x3::validate(&input_info.clone()->set_is_resizable(false), |
| 160 | &weights_info.clone()->set_is_resizable(false), &biases_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), conv_info, depth_multiplier, ActivationLayerInfo(), dilation)); |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 161 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 162 | } |
| 163 | |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 164 | DATA_TEST_CASE(ValidateGeneric, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip( |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 165 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights |
| 166 | TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps |
| 167 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier |
| 168 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size |
| 169 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions |
| 170 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 171 | TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // patch size bigger than input width |
| 172 | TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // dilation < 1 |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 173 | TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), |
| 174 | TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8), |
| 175 | }), |
| 176 | framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16), |
| 177 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 178 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 179 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 180 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 181 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 182 | TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 183 | TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32), |
| 184 | TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 185 | TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8), |
| 186 | })), |
| 187 | framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 188 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 189 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 190 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
| 191 | TensorInfo(TensorShape(2U, 2U), 1, DataType::F32), |
| 192 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 193 | TensorInfo(TensorShape(16U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 194 | TensorInfo(TensorShape(16U), 1, DataType::F32), |
| 195 | TensorInfo(TensorShape(16U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 196 | TensorInfo(TensorShape(24U), 1, DataType::S32), |
| 197 | })), |
| 198 | framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 199 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 200 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 201 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 202 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 203 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), |
| 204 | TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 205 | TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32), |
| 206 | TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 207 | TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8), |
| 208 | })), |
| 209 | framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0), |
| 210 | PadStrideInfo(1, 1, 0, 0), |
| 211 | PadStrideInfo(1, 1, 0, 0), |
| 212 | PadStrideInfo(1, 1, 0, 0), |
| 213 | PadStrideInfo(1, 1, 0, 0), |
| 214 | PadStrideInfo(1, 1, 0, 0), |
| 215 | PadStrideInfo(1, 1, 0, 0), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 216 | PadStrideInfo(1, 1, 0, 0), |
| 217 | PadStrideInfo(1, 1, 0, 0), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 218 | PadStrideInfo(1, 1, 1, 0), |
| 219 | })), |
| 220 | framework::dataset::make("DepthMultiplier", { 1, |
| 221 | 1, |
| 222 | 3, |
| 223 | 1, |
| 224 | 1, |
| 225 | 1, |
| 226 | 2, |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 227 | 2, |
| 228 | 2, |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 229 | 3, |
| 230 | })), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 231 | framework::dataset::make("Dilation", { Size2D(1U, 1U), |
| 232 | Size2D(1U, 1U), |
| 233 | Size2D(1U, 1U), |
| 234 | Size2D(1U, 1U), |
| 235 | Size2D(1U, 1U), |
| 236 | Size2D(1U, 1U), |
| 237 | Size2D(25U, 1U), |
| 238 | Size2D(0U, 1U), |
| 239 | Size2D(1U, 1U), |
| 240 | Size2D(1U, 1U), |
| 241 | })), |
| 242 | framework::dataset::make("Expected", { false, false, false, false, false, false,false, false, true, true })), |
| 243 | input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected) |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 244 | { |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 245 | bool is_valid = bool(NEDepthwiseConvolutionLayer::validate(&input_info.clone()->set_is_resizable(false), &weights_info.clone()->set_is_resizable(false), &biases_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), conv_info, depth_multiplier, ActivationLayerInfo(), dilation)); |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 246 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
| 247 | } |
| 248 | // clang-format on |
| 249 | // *INDENT-ON* |
| 250 | |
Dmitry Savenko | d7295b7 | 2017-11-20 22:00:08 +0700 | [diff] [blame] | 251 | TEST_SUITE(Float) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 252 | TEST_SUITE(F32) |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 253 | TEST_SUITE(Generic) |
| 254 | template <typename T> |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 255 | using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>; |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 256 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 257 | depth_multipliers), |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 258 | framework::dataset::make("DataType", |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 259 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 260 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 261 | ActivationFunctionsDataset)) |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 262 | { |
| 263 | validate(Accessor(_target), _reference, tolerance_f32); |
| 264 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 265 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 266 | depth_multipliers), |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 267 | framework::dataset::make("DataType", |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 268 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 269 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 270 | ActivationFunctionsDataset)) |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 271 | { |
| 272 | validate(Accessor(_target), _reference, tolerance_f32); |
| 273 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 274 | |
| 275 | TEST_SUITE(Dilation) |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 276 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 277 | depth_multipliers), |
| 278 | framework::dataset::make("DataType", |
| 279 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 280 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 281 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 282 | { |
| 283 | validate(Accessor(_target), _reference, tolerance_f32); |
| 284 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 285 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 286 | depth_multipliers), |
| 287 | framework::dataset::make("DataType", |
| 288 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 289 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 290 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 291 | { |
| 292 | validate(Accessor(_target), _reference, tolerance_f32); |
| 293 | } |
| 294 | TEST_SUITE_END() // Dilation |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 295 | TEST_SUITE_END() // Generic |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 296 | |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 297 | TEST_SUITE(W3x3) |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 298 | template <typename T> |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 299 | using NEDepthwiseConvolutionLayerFixture3x3 = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>; |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 300 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 301 | depth_multipliers), |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 302 | framework::dataset::make("DataType", |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 303 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 304 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 305 | ActivationFunctionsDataset)) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 306 | { |
| 307 | validate(Accessor(_target), _reference, tolerance_f32); |
| 308 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 309 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 310 | depth_multipliers), |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 311 | framework::dataset::make("DataType", |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 312 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 313 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 314 | ActivationFunctionsDataset)) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 315 | { |
| 316 | validate(Accessor(_target), _reference, tolerance_f32); |
| 317 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 318 | TEST_SUITE(Dilation) |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 319 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 320 | depth_multipliers), |
| 321 | framework::dataset::make("DataType", |
| 322 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 323 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 324 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 325 | { |
| 326 | validate(Accessor(_target), _reference, tolerance_f32); |
| 327 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 328 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, |
| 329 | combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 330 | depth_multipliers), |
| 331 | framework::dataset::make("DataType", |
| 332 | DataType::F32)), |
| 333 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 334 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 335 | { |
| 336 | validate(Accessor(_target), _reference, tolerance_f32); |
| 337 | } |
| 338 | |
| 339 | TEST_SUITE_END() // Dilation |
| 340 | |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 341 | FIXTURE_DATA_TEST_CASE(RunOptimizedSmall, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 342 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 343 | framework::dataset::make("DepthMultiplier", 1)), |
| 344 | framework::dataset::make("DataType", |
| 345 | DataType::F32)), |
| 346 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 347 | ActivationFunctionsDataset)) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 348 | { |
| 349 | validate(Accessor(_target), _reference, tolerance_f32); |
| 350 | } |
| 351 | FIXTURE_DATA_TEST_CASE(RunOptimizedLarge, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 352 | combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 353 | framework::dataset::make("DepthMultiplier", 1)), |
| 354 | framework::dataset::make("DataType", |
| 355 | DataType::F32)), |
| 356 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 357 | ActivationFunctionsDataset)) |
Georgios Pinitas | 4074c99 | 2018-01-30 18:13:46 +0000 | [diff] [blame] | 358 | { |
| 359 | validate(Accessor(_target), _reference, tolerance_f32); |
| 360 | } |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 361 | TEST_SUITE_END() // W3x3 |
| 362 | TEST_SUITE_END() // F32 |
Pablo Tello | 941cd70 | 2017-12-12 14:35:00 +0000 | [diff] [blame] | 363 | |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 364 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
| 365 | TEST_SUITE(F16) |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 366 | TEST_SUITE(Generic) |
| 367 | template <typename T> |
| 368 | using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>; |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 369 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 370 | depth_multipliers), |
| 371 | framework::dataset::make("DataType", |
| 372 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 373 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 374 | ActivationFunctionsDataset)) |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 375 | { |
| 376 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 377 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 378 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 379 | depth_multipliers), |
| 380 | framework::dataset::make("DataType", |
| 381 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 382 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 383 | ActivationFunctionsDataset)) |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 384 | { |
| 385 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 386 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 387 | |
| 388 | TEST_SUITE(Dilation) |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 389 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 390 | depth_multipliers), |
| 391 | framework::dataset::make("DataType", |
| 392 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 393 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 394 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 395 | { |
| 396 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 397 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 398 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 399 | depth_multipliers), |
| 400 | framework::dataset::make("DataType", |
| 401 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 402 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 403 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 404 | { |
| 405 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 406 | } |
| 407 | TEST_SUITE_END() // Dilation |
| 408 | |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 409 | TEST_SUITE_END() // Generic |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 410 | TEST_SUITE(W3x3) |
| 411 | template <typename T> |
| 412 | using NEDepthwiseConvolutionLayerFixture3x3 = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>; |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 413 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 414 | depth_multipliers), |
| 415 | framework::dataset::make("DataType", |
| 416 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 417 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 418 | ActivationFunctionsDataset)) |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 419 | { |
| 420 | validate(Accessor(_target), _reference, tolerance_f16); |
| 421 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 422 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 423 | depth_multipliers), |
| 424 | framework::dataset::make("DataType", |
| 425 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 426 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 427 | ActivationFunctionsDataset)) |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 428 | { |
| 429 | validate(Accessor(_target), _reference, tolerance_f16); |
| 430 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 431 | |
| 432 | TEST_SUITE(Dilation) |
| 433 | |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 434 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 435 | depth_multipliers), |
| 436 | framework::dataset::make("DataType", |
| 437 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 438 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 439 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 440 | { |
| 441 | validate(Accessor(_target), _reference, tolerance_f16); |
| 442 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 443 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, |
| 444 | combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 445 | depth_multipliers), |
| 446 | framework::dataset::make("DataType", |
| 447 | DataType::F16)), |
| 448 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 449 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 450 | { |
| 451 | validate(Accessor(_target), _reference, tolerance_f16); |
| 452 | } |
| 453 | |
| 454 | TEST_SUITE_END() // Dilation |
| 455 | |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 456 | FIXTURE_DATA_TEST_CASE(RunOptimizedSmall, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 457 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 458 | framework::dataset::make("DepthMultiplier", 1)), |
| 459 | framework::dataset::make("DataType", |
| 460 | DataType::F16)), |
| 461 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 462 | ActivationFunctionsDataset)) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 463 | { |
| 464 | validate(Accessor(_target), _reference, tolerance_f16); |
| 465 | } |
| 466 | FIXTURE_DATA_TEST_CASE(RunOptimizedLarge, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 467 | combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 468 | framework::dataset::make("DepthMultiplier", 1)), |
| 469 | framework::dataset::make("DataType", |
| 470 | DataType::F16)), |
| 471 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 472 | ActivationFunctionsDataset)) |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 473 | { |
| 474 | validate(Accessor(_target), _reference, tolerance_f16); |
| 475 | } |
| 476 | TEST_SUITE_END() // W3x3 |
| 477 | TEST_SUITE_END() // FP16 |
| 478 | #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
| 479 | |
| 480 | TEST_SUITE_END() // Float |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 481 | |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 482 | template <typename T> |
| 483 | using NEDepthwiseConvolutionLayerQuantizedFixture3x3 = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>; |
Georgios Pinitas | d05dce4 | 2018-01-22 16:29:17 +0000 | [diff] [blame] | 484 | template <typename T> |
| 485 | using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>; |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 486 | |
| 487 | TEST_SUITE(Quantized) |
| 488 | TEST_SUITE(QASYMM8) |
Georgios Pinitas | d05dce4 | 2018-01-22 16:29:17 +0000 | [diff] [blame] | 489 | TEST_SUITE(Generic) |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 490 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 491 | combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 492 | depth_multipliers), |
| 493 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 494 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 495 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 496 | ActivationFunctionsDataset)) |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 497 | { |
| 498 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 499 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 500 | |
| 501 | TEST_SUITE(Dilation) |
| 502 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 503 | combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 504 | depth_multipliers), |
| 505 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 506 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 507 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 508 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 509 | { |
| 510 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 511 | } |
| 512 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 513 | combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
| 514 | depth_multipliers), |
| 515 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 516 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 517 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 518 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 519 | { |
| 520 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 521 | } |
| 522 | TEST_SUITE_END() //Dilation |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 523 | TEST_SUITE_END() // Generic |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 524 | TEST_SUITE(W3x3) |
| 525 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 526 | combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers), |
| 527 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 528 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 529 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 530 | ActivationFunctionsDataset)) |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 531 | { |
| 532 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 533 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 534 | FIXTURE_DATA_TEST_CASE(RunOptimizedSmall, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 535 | combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 536 | framework::dataset::make("DepthMultiplier", 1)), |
| 537 | framework::dataset::make("DataType", |
| 538 | DataType::QASYMM8)), |
| 539 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 540 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 541 | ActivationFunctionsDataset)) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 542 | { |
| 543 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 544 | } |
| 545 | FIXTURE_DATA_TEST_CASE(RunOptimizedLarge, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 546 | combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 547 | framework::dataset::make("DepthMultiplier", 1)), |
| 548 | framework::dataset::make("DataType", |
| 549 | DataType::QASYMM8)), |
| 550 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 551 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 552 | ActivationFunctionsDataset)) |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 553 | { |
| 554 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 555 | } |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 556 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 557 | combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
| 558 | depth_multipliers), |
| 559 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 560 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 561 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 562 | ActivationFunctionsDataset)) |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 563 | { |
| 564 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 565 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 566 | |
| 567 | TEST_SUITE(Dilation) |
| 568 | |
| 569 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 570 | combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers), |
| 571 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 572 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 573 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 574 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 575 | { |
| 576 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 577 | } |
| 578 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 579 | combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 580 | depth_multipliers), |
| 581 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 582 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 583 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 584 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 585 | { |
| 586 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 587 | } |
| 588 | TEST_SUITE_END() // Dilation |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 589 | TEST_SUITE_END() // W3x3 |
| 590 | TEST_SUITE_END() // QASYMM8 |
| 591 | TEST_SUITE_END() // Quantized |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 592 | |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 593 | TEST_SUITE_END() // DepthwiseConvLayer |
| 594 | TEST_SUITE_END() // NEON |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 595 | } // namespace validation |
| 596 | } // namespace test |
| 597 | } // namespace arm_compute |