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 }); |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 57 | } // namespace |
| 58 | |
| 59 | TEST_SUITE(NEON) |
Pablo Tello | 941cd70 | 2017-12-12 14:35:00 +0000 | [diff] [blame] | 60 | TEST_SUITE(DepthwiseConvLayer) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 61 | |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 62 | // *INDENT-OFF* |
| 63 | // clang-format off |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 64 | 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] | 65 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching data type input/weights |
| 66 | TensorInfo(TensorShape(32U, 18U, 3U), 1, DataType::F32), // Mismatching input feature maps |
| 67 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Unsupported weights dimensions |
| 68 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching depth multiplier |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 69 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::QASYMM8), // Invalid stride |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 70 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases size |
| 71 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases dimensions |
| 72 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid output size |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 73 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // patch size bigger than input width |
| 74 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // dilation < 1 |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 75 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 76 | }), |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 77 | framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16), |
| 78 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 79 | TensorInfo(TensorShape(5U, 5U, 2U, 2U), 1, DataType::F32), |
| 80 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 81 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::QASYMM8), |
| 82 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 83 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 84 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 85 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 86 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 87 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 88 | })), |
| 89 | framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 90 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 91 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 92 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 93 | TensorInfo(TensorShape(2U), 1, DataType::S32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 94 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
| 95 | TensorInfo(TensorShape(2U, 2U), 1, DataType::F32), |
| 96 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 97 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 98 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 99 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 100 | })), |
| 101 | framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 102 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 103 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 104 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 105 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::QASYMM8), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 106 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 107 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 108 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), |
| 109 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 110 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 111 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 112 | })), |
| 113 | framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0), |
| 114 | PadStrideInfo(1, 1, 0, 0), |
| 115 | PadStrideInfo(1, 1, 0, 0), |
| 116 | PadStrideInfo(1, 1, 0, 0), |
| 117 | PadStrideInfo(4, 1, 0, 0), |
| 118 | PadStrideInfo(1, 1, 0, 0), |
| 119 | PadStrideInfo(1, 1, 0, 0), |
| 120 | PadStrideInfo(1, 1, 0, 0), |
| 121 | PadStrideInfo(1, 1, 0, 0), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 122 | PadStrideInfo(1, 1, 0, 0), |
| 123 | PadStrideInfo(1, 1, 0, 0), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 124 | })), |
| 125 | framework::dataset::make("DepthMultiplier", { 1, |
| 126 | 1, |
| 127 | 1, |
| 128 | 3, |
| 129 | 1, |
| 130 | 1, |
| 131 | 1, |
| 132 | 1, |
| 133 | 1, |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 134 | 1, |
| 135 | 1, |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 136 | })), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 137 | framework::dataset::make("Dilation", { Size2D(1U, 1U), |
| 138 | Size2D(1U, 1U), |
| 139 | Size2D(1U, 1U), |
| 140 | Size2D(1U, 1U), |
| 141 | Size2D(1U, 1U), |
| 142 | Size2D(1U, 1U), |
| 143 | Size2D(1U, 1U), |
| 144 | Size2D(1U, 1U), |
| 145 | Size2D(25U, 1U), |
| 146 | Size2D(0U, 1U), |
| 147 | Size2D(1U, 1U), |
| 148 | })), |
| 149 | framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, false, false, true })), |
| 150 | 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] | 151 | { |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 152 | bool is_valid = bool(NEDepthwiseConvolutionLayer3x3::validate(&input_info.clone()->set_is_resizable(false), |
| 153 | &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] | 154 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 155 | } |
| 156 | |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 157 | 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] | 158 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights |
| 159 | TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps |
| 160 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier |
| 161 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size |
| 162 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions |
| 163 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 164 | TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // patch size bigger than input width |
| 165 | TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // dilation < 1 |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 166 | TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), |
| 167 | TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8), |
| 168 | }), |
| 169 | framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16), |
| 170 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 171 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 172 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 173 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 174 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 175 | TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 176 | TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32), |
| 177 | TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 178 | TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8), |
| 179 | })), |
| 180 | framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 181 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 182 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 183 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
| 184 | TensorInfo(TensorShape(2U, 2U), 1, DataType::F32), |
| 185 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 186 | TensorInfo(TensorShape(16U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 187 | TensorInfo(TensorShape(16U), 1, DataType::F32), |
| 188 | TensorInfo(TensorShape(16U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 189 | TensorInfo(TensorShape(24U), 1, DataType::S32), |
| 190 | })), |
| 191 | framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 192 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 193 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 194 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 195 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 196 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), |
| 197 | TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 198 | TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32), |
| 199 | TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 200 | TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8), |
| 201 | })), |
| 202 | framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0), |
| 203 | PadStrideInfo(1, 1, 0, 0), |
| 204 | PadStrideInfo(1, 1, 0, 0), |
| 205 | PadStrideInfo(1, 1, 0, 0), |
| 206 | PadStrideInfo(1, 1, 0, 0), |
| 207 | PadStrideInfo(1, 1, 0, 0), |
| 208 | PadStrideInfo(1, 1, 0, 0), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 209 | PadStrideInfo(1, 1, 0, 0), |
| 210 | PadStrideInfo(1, 1, 0, 0), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 211 | PadStrideInfo(1, 1, 1, 0), |
| 212 | })), |
| 213 | framework::dataset::make("DepthMultiplier", { 1, |
| 214 | 1, |
| 215 | 3, |
| 216 | 1, |
| 217 | 1, |
| 218 | 1, |
| 219 | 2, |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 220 | 2, |
| 221 | 2, |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 222 | 3, |
| 223 | })), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 224 | framework::dataset::make("Dilation", { Size2D(1U, 1U), |
| 225 | Size2D(1U, 1U), |
| 226 | Size2D(1U, 1U), |
| 227 | Size2D(1U, 1U), |
| 228 | Size2D(1U, 1U), |
| 229 | Size2D(1U, 1U), |
| 230 | Size2D(25U, 1U), |
| 231 | Size2D(0U, 1U), |
| 232 | Size2D(1U, 1U), |
| 233 | Size2D(1U, 1U), |
| 234 | })), |
| 235 | framework::dataset::make("Expected", { false, false, false, false, false, false,false, false, true, true })), |
| 236 | 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] | 237 | { |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 238 | 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] | 239 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
| 240 | } |
| 241 | // clang-format on |
| 242 | // *INDENT-ON* |
| 243 | |
Dmitry Savenko | d7295b7 | 2017-11-20 22:00:08 +0700 | [diff] [blame] | 244 | TEST_SUITE(Float) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 245 | TEST_SUITE(F32) |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 246 | TEST_SUITE(Generic) |
| 247 | template <typename T> |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 248 | using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>; |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 249 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 250 | depth_multipliers), |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 251 | framework::dataset::make("DataType", |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 252 | DataType::F32)), |
Giorgio Arena | 26b2216 | 2018-08-13 15:49:49 +0100 | [diff] [blame] | 253 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 254 | { |
| 255 | validate(Accessor(_target), _reference, tolerance_f32); |
| 256 | } |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 257 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
| 258 | depth_multipliers), |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 259 | framework::dataset::make("DataType", |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 260 | DataType::F32)), |
Giorgio Arena | 26b2216 | 2018-08-13 15:49:49 +0100 | [diff] [blame] | 261 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 262 | { |
| 263 | validate(Accessor(_target), _reference, tolerance_f32); |
| 264 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 265 | |
| 266 | TEST_SUITE(Dilation) |
| 267 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 268 | depth_multipliers), |
| 269 | framework::dataset::make("DataType", |
| 270 | DataType::F32)), |
| 271 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 272 | { |
| 273 | validate(Accessor(_target), _reference, tolerance_f32); |
| 274 | } |
| 275 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
| 276 | depth_multipliers), |
| 277 | framework::dataset::make("DataType", |
| 278 | DataType::F32)), |
| 279 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 280 | { |
| 281 | validate(Accessor(_target), _reference, tolerance_f32); |
| 282 | } |
| 283 | TEST_SUITE_END() // Dilation |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 284 | TEST_SUITE_END() // Generic |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 285 | |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 286 | TEST_SUITE(W3x3) |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 287 | template <typename T> |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 288 | using NEDepthwiseConvolutionLayerFixture3x3 = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>; |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 289 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 290 | depth_multipliers), |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 291 | framework::dataset::make("DataType", |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 292 | DataType::F32)), |
Giorgio Arena | 26b2216 | 2018-08-13 15:49:49 +0100 | [diff] [blame] | 293 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 294 | { |
| 295 | validate(Accessor(_target), _reference, tolerance_f32); |
| 296 | } |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 297 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
| 298 | depth_multipliers), |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 299 | framework::dataset::make("DataType", |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 300 | DataType::F32)), |
Giorgio Arena | 26b2216 | 2018-08-13 15:49:49 +0100 | [diff] [blame] | 301 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 302 | { |
| 303 | validate(Accessor(_target), _reference, tolerance_f32); |
| 304 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 305 | TEST_SUITE(Dilation) |
| 306 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 307 | depth_multipliers), |
| 308 | framework::dataset::make("DataType", |
| 309 | DataType::F32)), |
| 310 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 311 | { |
| 312 | validate(Accessor(_target), _reference, tolerance_f32); |
| 313 | } |
| 314 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 315 | depth_multipliers), |
| 316 | framework::dataset::make("DataType", |
| 317 | DataType::F32)), |
| 318 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 319 | { |
| 320 | validate(Accessor(_target), _reference, tolerance_f32); |
| 321 | } |
| 322 | |
| 323 | TEST_SUITE_END() // Dilation |
| 324 | |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 325 | FIXTURE_DATA_TEST_CASE(RunOptimizedSmall, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, |
| 326 | combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 327 | framework::dataset::make("DepthMultiplier", 1)), |
| 328 | framework::dataset::make("DataType", |
| 329 | DataType::F32)), |
| 330 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 331 | { |
| 332 | validate(Accessor(_target), _reference, tolerance_f32); |
| 333 | } |
| 334 | FIXTURE_DATA_TEST_CASE(RunOptimizedLarge, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, |
| 335 | combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 336 | framework::dataset::make("DepthMultiplier", 1)), |
| 337 | framework::dataset::make("DataType", |
| 338 | DataType::F32)), |
| 339 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Georgios Pinitas | 4074c99 | 2018-01-30 18:13:46 +0000 | [diff] [blame] | 340 | { |
| 341 | validate(Accessor(_target), _reference, tolerance_f32); |
| 342 | } |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 343 | TEST_SUITE_END() // W3x3 |
| 344 | TEST_SUITE_END() // F32 |
Pablo Tello | 941cd70 | 2017-12-12 14:35:00 +0000 | [diff] [blame] | 345 | |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 346 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
| 347 | TEST_SUITE(F16) |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 348 | TEST_SUITE(Generic) |
| 349 | template <typename T> |
| 350 | using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>; |
| 351 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 352 | depth_multipliers), |
| 353 | framework::dataset::make("DataType", |
| 354 | DataType::F16)), |
| 355 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 356 | { |
| 357 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 358 | } |
| 359 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
| 360 | depth_multipliers), |
| 361 | framework::dataset::make("DataType", |
| 362 | DataType::F16)), |
| 363 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 364 | { |
| 365 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 366 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 367 | |
| 368 | TEST_SUITE(Dilation) |
| 369 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 370 | depth_multipliers), |
| 371 | framework::dataset::make("DataType", |
| 372 | DataType::F16)), |
| 373 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 374 | { |
| 375 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 376 | } |
| 377 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
| 378 | depth_multipliers), |
| 379 | framework::dataset::make("DataType", |
| 380 | DataType::F16)), |
| 381 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 382 | { |
| 383 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 384 | } |
| 385 | TEST_SUITE_END() // Dilation |
| 386 | |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 387 | TEST_SUITE_END() // Generic |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 388 | TEST_SUITE(W3x3) |
| 389 | template <typename T> |
| 390 | using NEDepthwiseConvolutionLayerFixture3x3 = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>; |
| 391 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 392 | depth_multipliers), |
| 393 | framework::dataset::make("DataType", |
| 394 | DataType::F16)), |
| 395 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 396 | { |
| 397 | validate(Accessor(_target), _reference, tolerance_f16); |
| 398 | } |
| 399 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
| 400 | depth_multipliers), |
| 401 | framework::dataset::make("DataType", |
| 402 | DataType::F16)), |
| 403 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 404 | { |
| 405 | validate(Accessor(_target), _reference, tolerance_f16); |
| 406 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 407 | |
| 408 | TEST_SUITE(Dilation) |
| 409 | |
| 410 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 411 | depth_multipliers), |
| 412 | framework::dataset::make("DataType", |
| 413 | DataType::F16)), |
| 414 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 415 | { |
| 416 | validate(Accessor(_target), _reference, tolerance_f16); |
| 417 | } |
| 418 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 419 | depth_multipliers), |
| 420 | framework::dataset::make("DataType", |
| 421 | DataType::F16)), |
| 422 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 423 | { |
| 424 | validate(Accessor(_target), _reference, tolerance_f16); |
| 425 | } |
| 426 | |
| 427 | TEST_SUITE_END() // Dilation |
| 428 | |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 429 | FIXTURE_DATA_TEST_CASE(RunOptimizedSmall, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT, |
| 430 | combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 431 | framework::dataset::make("DepthMultiplier", 1)), |
| 432 | framework::dataset::make("DataType", |
| 433 | DataType::F16)), |
| 434 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 435 | { |
| 436 | validate(Accessor(_target), _reference, tolerance_f16); |
| 437 | } |
| 438 | FIXTURE_DATA_TEST_CASE(RunOptimizedLarge, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, |
| 439 | combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 440 | framework::dataset::make("DepthMultiplier", 1)), |
| 441 | framework::dataset::make("DataType", |
| 442 | DataType::F16)), |
| 443 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 444 | { |
| 445 | validate(Accessor(_target), _reference, tolerance_f16); |
| 446 | } |
| 447 | TEST_SUITE_END() // W3x3 |
| 448 | TEST_SUITE_END() // FP16 |
| 449 | #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
| 450 | |
| 451 | TEST_SUITE_END() // Float |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 452 | |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 453 | template <typename T> |
| 454 | using NEDepthwiseConvolutionLayerQuantizedFixture3x3 = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>; |
Georgios Pinitas | d05dce4 | 2018-01-22 16:29:17 +0000 | [diff] [blame] | 455 | template <typename T> |
| 456 | using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>; |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 457 | |
| 458 | TEST_SUITE(Quantized) |
| 459 | TEST_SUITE(QASYMM8) |
Georgios Pinitas | d05dce4 | 2018-01-22 16:29:17 +0000 | [diff] [blame] | 460 | TEST_SUITE(Generic) |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 461 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 462 | combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 463 | depth_multipliers), |
Giorgio Arena | dfca60b | 2018-01-31 10:30:59 +0000 | [diff] [blame] | 464 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 465 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
Giorgio Arena | 26b2216 | 2018-08-13 15:49:49 +0100 | [diff] [blame] | 466 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 467 | { |
| 468 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 469 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 470 | |
| 471 | TEST_SUITE(Dilation) |
| 472 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 473 | combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 474 | depth_multipliers), |
| 475 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 476 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 477 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 478 | { |
| 479 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 480 | } |
| 481 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
| 482 | combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
| 483 | depth_multipliers), |
| 484 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 485 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 486 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 487 | { |
| 488 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 489 | } |
| 490 | TEST_SUITE_END() //Dilation |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 491 | TEST_SUITE_END() // Generic |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 492 | TEST_SUITE(W3x3) |
| 493 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 494 | combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers), |
| 495 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 496 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
Giorgio Arena | 26b2216 | 2018-08-13 15:49:49 +0100 | [diff] [blame] | 497 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 498 | { |
| 499 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 500 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 501 | FIXTURE_DATA_TEST_CASE(RunOptimizedSmall, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 502 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 503 | framework::dataset::make("DepthMultiplier", 1)), |
| 504 | framework::dataset::make("DataType", |
| 505 | DataType::QASYMM8)), |
| 506 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 507 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 508 | { |
| 509 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 510 | } |
| 511 | FIXTURE_DATA_TEST_CASE(RunOptimizedLarge, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, |
| 512 | combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Georgios Pinitas | a799ce0 | 2018-09-12 20:11:34 +0100 | [diff] [blame] | 513 | framework::dataset::make("DepthMultiplier", 1)), |
| 514 | framework::dataset::make("DataType", |
| 515 | DataType::QASYMM8)), |
| 516 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 517 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 518 | { |
| 519 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 520 | } |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 521 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, |
| 522 | combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
| 523 | depth_multipliers), |
| 524 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 525 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
Giorgio Arena | 26b2216 | 2018-08-13 15:49:49 +0100 | [diff] [blame] | 526 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 527 | { |
| 528 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 529 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 530 | |
| 531 | TEST_SUITE(Dilation) |
| 532 | |
| 533 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 534 | combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers), |
| 535 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 536 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 537 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 538 | { |
| 539 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 540 | } |
| 541 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, |
| 542 | combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 543 | depth_multipliers), |
| 544 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 545 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 546 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 547 | { |
| 548 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 549 | } |
| 550 | TEST_SUITE_END() // Dilation |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 551 | TEST_SUITE_END() // W3x3 |
| 552 | TEST_SUITE_END() // QASYMM8 |
| 553 | TEST_SUITE_END() // Quantized |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 554 | |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 555 | TEST_SUITE_END() // DepthwiseConvLayer |
| 556 | TEST_SUITE_END() // NEON |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 557 | } // namespace validation |
| 558 | } // namespace test |
| 559 | } // namespace arm_compute |