Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 1 | /* |
Michele Di Giorgio | d9eaf61 | 2020-07-08 11:12:57 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2020 Arm Limited. |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +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, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
| 24 | #include "arm_compute/core/Types.h" |
| 25 | #include "arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h" |
| 26 | #include "arm_compute/runtime/Tensor.h" |
| 27 | #include "arm_compute/runtime/TensorAllocator.h" |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 28 | #include "tests/NEON/Accessor.h" |
| 29 | #include "tests/PaddingCalculator.h" |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 30 | #include "tests/datasets/FullyConnectedLayerDataset.h" |
| 31 | #include "tests/framework/Asserts.h" |
| 32 | #include "tests/framework/Macros.h" |
| 33 | #include "tests/framework/datasets/Datasets.h" |
| 34 | #include "tests/validation/Validation.h" |
| 35 | #include "tests/validation/fixtures/FullyConnectedLayerFixture.h" |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 36 | |
| 37 | namespace arm_compute |
| 38 | { |
| 39 | namespace test |
| 40 | { |
| 41 | namespace validation |
| 42 | { |
| 43 | namespace |
| 44 | { |
| 45 | /** Tolerance for float operations */ |
Michele Di Giorgio | 419f33a | 2018-08-27 14:25:24 +0100 | [diff] [blame] | 46 | constexpr RelativeTolerance<float> rel_tolerance_f32(0.01f); /**< Relative tolerance value for comparing reference's output against implementation's output for DataType::F32 */ |
| 47 | constexpr AbsoluteTolerance<float> abs_tolerance_f32(0.001f); /**< Absolute tolerance value for comparing reference's output against implementation's output for DataType::F32 */ |
Ioan-Cristian Szabo | 5edbd1c | 2017-11-13 13:34:08 +0000 | [diff] [blame] | 48 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Gian Marco Iodice | 35aea37 | 2018-08-24 14:30:36 +0100 | [diff] [blame] | 49 | const AbsoluteTolerance<float> abs_tolerance_f16(0.3f); /**< Absolute tolerance value for comparing reference's output against implementation's output for DataType::F16 */ |
| 50 | const RelativeTolerance<half_float::half> rel_tolerance_f16(half_float::half(0.2f)); /**< Relative tolerance value for comparing reference's output against implementation's output for DataType::F16 */ |
| 51 | constexpr float tolerance_num_f16 = 0.07f; /**< Tolerance number for FP16 */ |
| 52 | #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC*/ |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 53 | |
Giorgio Arena | a855af1 | 2018-07-16 17:20:38 +0100 | [diff] [blame] | 54 | /** Tolerance for quantized asymmetric operations */ |
| 55 | constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1); |
Michele Di Giorgio | 9c70037 | 2020-01-08 11:33:44 +0000 | [diff] [blame] | 56 | constexpr AbsoluteTolerance<int8_t> tolerance_qasymm8_signed(1); |
Giorgio Arena | a855af1 | 2018-07-16 17:20:38 +0100 | [diff] [blame] | 57 | |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 58 | /** CNN data types */ |
| 59 | const auto CNNDataTypes = framework::dataset::make("DataType", |
| 60 | { |
Ioan-Cristian Szabo | 5edbd1c | 2017-11-13 13:34:08 +0000 | [diff] [blame] | 61 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 62 | DataType::F16, |
Ioan-Cristian Szabo | 5edbd1c | 2017-11-13 13:34:08 +0000 | [diff] [blame] | 63 | #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */ |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 64 | DataType::F32, |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 65 | }); |
| 66 | |
| 67 | const auto FullyConnectedParameters = combine(framework::dataset::make("TransposeWeights", { false, true }), framework::dataset::make("ReshapeWeights", { false, true })); |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 68 | |
| 69 | const auto QuantizationData = framework::dataset::make("QuantizationInfo", |
| 70 | { |
| 71 | QuantizationInfo(1.f / 256.f, 10), |
| 72 | QuantizationInfo(1.1f, 10), |
| 73 | }); |
SiCongLi | 2e5fd63 | 2020-03-02 15:39:15 +0000 | [diff] [blame] | 74 | const auto EmptyActivationFunctionDataset = framework::dataset::make("ActivationInfo", |
| 75 | { |
| 76 | ActivationLayerInfo(), |
| 77 | }); |
| 78 | const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo", |
| 79 | { |
| 80 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 81 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 0.5f), |
| 82 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 0.75f, 0.25f), |
| 83 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), |
| 84 | }); |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 85 | |
SiCongLi | 2e5fd63 | 2020-03-02 15:39:15 +0000 | [diff] [blame] | 86 | const auto ActivationFunctionsQuantizedDataset = framework::dataset::make("ActivationInfo", |
| 87 | { |
| 88 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 89 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 0.5f), |
| 90 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 0.75f, 0.25f), |
| 91 | }); |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 92 | } // namespace |
| 93 | |
| 94 | TEST_SUITE(NEON) |
| 95 | TEST_SUITE(FullyConnectedLayer) |
| 96 | |
Ioan-Cristian Szabo | b4e3e1c | 2017-11-30 17:17:17 +0000 | [diff] [blame] | 97 | // *INDENT-OFF* |
| 98 | // clang-format off |
| 99 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip( |
| 100 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(9U, 5U, 7U, 3U), 1, DataType::F32), // Mismatching data types |
Ioan-Cristian Szabo | b4e3e1c | 2017-11-30 17:17:17 +0000 | [diff] [blame] | 101 | TensorInfo(TensorShape(8U, 4U, 6U, 4U), 1, DataType::F32), |
| 102 | TensorInfo(TensorShape(8U, 4U, 6U, 4U), 1, DataType::F32), |
| 103 | TensorInfo(TensorShape(9U, 5U, 7U, 3U), 1, DataType::F32), // Invalid weights dimensions |
| 104 | TensorInfo(TensorShape(9U, 5U, 7U, 3U), 1, DataType::F32), // Wrongly reshaped weights |
| 105 | TensorInfo(TensorShape(8U, 4U, 6U, 4U), 1, DataType::F32), |
| 106 | }), |
| 107 | framework::dataset::make("WeightsInfo",{ TensorInfo(TensorShape(315U, 271U), 1, DataType::F16), |
Ioan-Cristian Szabo | b4e3e1c | 2017-11-30 17:17:17 +0000 | [diff] [blame] | 108 | TensorInfo(TensorShape(192U, 192U), 1, DataType::F32), |
| 109 | TensorInfo(TensorShape(192U, 192U), 1, DataType::F32), |
| 110 | TensorInfo(TensorShape(217U, 315U), 1, DataType::F32), |
| 111 | TensorInfo(TensorShape(217U, 315U), 1, DataType::F32), |
| 112 | TensorInfo(TensorShape(192U, 192U), 1, DataType::F32), |
| 113 | })), |
| 114 | framework::dataset::make("BiasInfo",{ TensorInfo(TensorShape(271U), 1, DataType::F32), |
Ioan-Cristian Szabo | b4e3e1c | 2017-11-30 17:17:17 +0000 | [diff] [blame] | 115 | TensorInfo(TensorShape(192U), 1, DataType::F32), |
| 116 | TensorInfo(TensorShape(192U), 1, DataType::F32), |
| 117 | TensorInfo(TensorShape(271U), 1, DataType::F32), |
| 118 | TensorInfo(TensorShape(271U), 1, DataType::F32), |
| 119 | TensorInfo(TensorShape(192U), 1, DataType::F32), |
| 120 | })), |
| 121 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(271U, 3U), 1, DataType::F32), |
Ioan-Cristian Szabo | b4e3e1c | 2017-11-30 17:17:17 +0000 | [diff] [blame] | 122 | TensorInfo(TensorShape(192U, 4U), 1, DataType::F32), |
| 123 | TensorInfo(TensorShape(192U, 4U), 1, DataType::F32), |
| 124 | TensorInfo(TensorShape(271U, 3U), 1, DataType::F32), |
| 125 | TensorInfo(TensorShape(271U, 3U), 1, DataType::F32), |
| 126 | TensorInfo(TensorShape(192U, 4U), 1, DataType::F32), |
| 127 | })), |
Vidhya Sudhan Loganathan | 0fc2545 | 2018-06-18 14:40:56 +0100 | [diff] [blame] | 128 | framework::dataset::make("TransposeWeights",{ true, true, false, true, true, true })), |
| 129 | framework::dataset::make("ReshapedWeights",{ false, false, false, false, false , false})), |
| 130 | framework::dataset::make("Expected", { false, true, true, false, false, true })), |
Ioan-Cristian Szabo | b4e3e1c | 2017-11-30 17:17:17 +0000 | [diff] [blame] | 131 | input_info, weights_info, bias_info, output_info, transpose_weights, reshaped_weights, expected) |
| 132 | { |
Georgios Pinitas | 7d66a8e | 2018-07-17 12:28:42 +0100 | [diff] [blame] | 133 | // Create Fully Connected layer info |
| 134 | FullyConnectedLayerInfo fc_info; |
| 135 | fc_info.transpose_weights = transpose_weights; |
| 136 | fc_info.are_weights_reshaped = reshaped_weights; |
| 137 | |
| 138 | Status status = NEFullyConnectedLayer::validate(&input_info.clone()->set_is_resizable(false), &weights_info.clone()->set_is_resizable(false), &bias_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), fc_info); |
Ioan-Cristian Szabo | b4e3e1c | 2017-11-30 17:17:17 +0000 | [diff] [blame] | 139 | ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS); |
| 140 | } |
| 141 | // clang-format on |
| 142 | // *INDENT-ON* |
| 143 | |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 144 | template <typename T> |
Giorgio Arena | a855af1 | 2018-07-16 17:20:38 +0100 | [diff] [blame] | 145 | using NEFullyConnectedLayerFixture = FullyConnectedLayerValidationFixture<Tensor, Accessor, NEFullyConnectedLayer, T>; |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 146 | |
| 147 | TEST_SUITE(Float) |
Ioan-Cristian Szabo | 5edbd1c | 2017-11-13 13:34:08 +0000 | [diff] [blame] | 148 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 149 | TEST_SUITE(FP16) |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 150 | FIXTURE_DATA_TEST_CASE(RunSmall, NEFullyConnectedLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallFullyConnectedLayerDataset(), |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 151 | FullyConnectedParameters), |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 152 | framework::dataset::make("DataType", DataType::F16)), |
SiCongLi | 2e5fd63 | 2020-03-02 15:39:15 +0000 | [diff] [blame] | 153 | EmptyActivationFunctionDataset)) |
| 154 | { |
| 155 | // Validate output |
| 156 | validate(Accessor(_target), _reference, rel_tolerance_f16, tolerance_num_f16, abs_tolerance_f16); |
| 157 | } |
| 158 | FIXTURE_DATA_TEST_CASE(RunWithActivation, NEFullyConnectedLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine( |
| 159 | combine(datasets::FullyConnectedLayerWithActivationDataset(), |
| 160 | FullyConnectedParameters), |
| 161 | framework::dataset::make("DataType", DataType::F16)), |
| 162 | ActivationFunctionsDataset)) |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 163 | { |
| 164 | // Validate output |
Gian Marco Iodice | 35aea37 | 2018-08-24 14:30:36 +0100 | [diff] [blame] | 165 | validate(Accessor(_target), _reference, rel_tolerance_f16, tolerance_num_f16, abs_tolerance_f16); |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 166 | } |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 167 | FIXTURE_DATA_TEST_CASE(RunLarge, NEFullyConnectedLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeFullyConnectedLayerDataset(), |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 168 | FullyConnectedParameters), |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 169 | framework::dataset::make("DataType", DataType::F16)), |
SiCongLi | 2e5fd63 | 2020-03-02 15:39:15 +0000 | [diff] [blame] | 170 | EmptyActivationFunctionDataset)) |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 171 | { |
| 172 | // Validate output |
Gian Marco Iodice | 35aea37 | 2018-08-24 14:30:36 +0100 | [diff] [blame] | 173 | validate(Accessor(_target), _reference, rel_tolerance_f16, tolerance_num_f16, abs_tolerance_f16); |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 174 | } |
| 175 | TEST_SUITE_END() |
Ioan-Cristian Szabo | 5edbd1c | 2017-11-13 13:34:08 +0000 | [diff] [blame] | 176 | #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */ |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 177 | |
| 178 | TEST_SUITE(FP32) |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 179 | FIXTURE_DATA_TEST_CASE(RunSmall, NEFullyConnectedLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallFullyConnectedLayerDataset(), FullyConnectedParameters), |
| 180 | framework::dataset::make("DataType", DataType::F32)), |
SiCongLi | 2e5fd63 | 2020-03-02 15:39:15 +0000 | [diff] [blame] | 181 | EmptyActivationFunctionDataset)) |
| 182 | { |
| 183 | // Validate output |
| 184 | validate(Accessor(_target), _reference, rel_tolerance_f32, 0, abs_tolerance_f32); |
| 185 | } |
| 186 | FIXTURE_DATA_TEST_CASE(RunWithActivation, NEFullyConnectedLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine( |
| 187 | combine(datasets::FullyConnectedLayerWithActivationDataset(), |
| 188 | FullyConnectedParameters), |
| 189 | framework::dataset::make("DataType", DataType::F32)), |
| 190 | ActivationFunctionsDataset)) |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 191 | { |
| 192 | // Validate output |
Michele Di Giorgio | 419f33a | 2018-08-27 14:25:24 +0100 | [diff] [blame] | 193 | validate(Accessor(_target), _reference, rel_tolerance_f32, 0, abs_tolerance_f32); |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 194 | } |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 195 | FIXTURE_DATA_TEST_CASE(RunLarge, NEFullyConnectedLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeFullyConnectedLayerDataset(), FullyConnectedParameters), |
| 196 | framework::dataset::make("DataType", DataType::F32)), |
SiCongLi | 2e5fd63 | 2020-03-02 15:39:15 +0000 | [diff] [blame] | 197 | EmptyActivationFunctionDataset)) |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 198 | { |
| 199 | // Validate output |
Michele Di Giorgio | 419f33a | 2018-08-27 14:25:24 +0100 | [diff] [blame] | 200 | validate(Accessor(_target), _reference, rel_tolerance_f32, 0, abs_tolerance_f32); |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 201 | } |
| 202 | TEST_SUITE_END() |
| 203 | TEST_SUITE_END() |
| 204 | |
Giorgio Arena | a855af1 | 2018-07-16 17:20:38 +0100 | [diff] [blame] | 205 | template <typename T> |
| 206 | using NEFullyConnectedLayerQuantizedFixture = FullyConnectedLayerValidationQuantizedFixture<Tensor, Accessor, NEFullyConnectedLayer, T>; |
| 207 | |
| 208 | TEST_SUITE(Quantized) |
| 209 | TEST_SUITE(QASYMM8) |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 210 | FIXTURE_DATA_TEST_CASE(RunSmall, NEFullyConnectedLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine( |
Giorgio Arena | a855af1 | 2018-07-16 17:20:38 +0100 | [diff] [blame] | 211 | combine(datasets::SmallFullyConnectedLayerDataset(), |
| 212 | FullyConnectedParameters), |
| 213 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 214 | QuantizationData), |
SiCongLi | 2e5fd63 | 2020-03-02 15:39:15 +0000 | [diff] [blame] | 215 | EmptyActivationFunctionDataset)) |
Giorgio Arena | a855af1 | 2018-07-16 17:20:38 +0100 | [diff] [blame] | 216 | { |
| 217 | // Validate output |
| 218 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 219 | } |
SiCongLi | 2e5fd63 | 2020-03-02 15:39:15 +0000 | [diff] [blame] | 220 | |
| 221 | FIXTURE_DATA_TEST_CASE(RunWithActivation, NEFullyConnectedLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine( |
| 222 | combine(datasets::FullyConnectedLayerWithActivationDataset(), |
| 223 | FullyConnectedParameters), |
| 224 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 225 | QuantizationData), |
| 226 | ActivationFunctionsQuantizedDataset)) |
| 227 | { |
| 228 | // Validate output |
| 229 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 230 | } |
| 231 | |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 232 | FIXTURE_DATA_TEST_CASE(RunLarge, NEFullyConnectedLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine( |
Giorgio Arena | a855af1 | 2018-07-16 17:20:38 +0100 | [diff] [blame] | 233 | combine(datasets::LargeFullyConnectedLayerDataset(), |
| 234 | FullyConnectedParameters), |
| 235 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 236 | QuantizationData), |
SiCongLi | 2e5fd63 | 2020-03-02 15:39:15 +0000 | [diff] [blame] | 237 | EmptyActivationFunctionDataset)) |
Giorgio Arena | a855af1 | 2018-07-16 17:20:38 +0100 | [diff] [blame] | 238 | { |
| 239 | // Validate output |
| 240 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 241 | } |
| 242 | TEST_SUITE_END() |
Michele Di Giorgio | 9c70037 | 2020-01-08 11:33:44 +0000 | [diff] [blame] | 243 | TEST_SUITE(QASYMM8_SIGNED) |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 244 | FIXTURE_DATA_TEST_CASE(RunSmall, NEFullyConnectedLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine( |
Michele Di Giorgio | 9c70037 | 2020-01-08 11:33:44 +0000 | [diff] [blame] | 245 | combine(datasets::SmallFullyConnectedLayerDataset(), |
| 246 | FullyConnectedParameters), |
| 247 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 248 | QuantizationData), |
SiCongLi | 2e5fd63 | 2020-03-02 15:39:15 +0000 | [diff] [blame] | 249 | EmptyActivationFunctionDataset)) |
| 250 | { |
| 251 | // Validate output |
| 252 | validate(Accessor(_target), _reference, tolerance_qasymm8_signed); |
| 253 | } |
| 254 | |
| 255 | FIXTURE_DATA_TEST_CASE(RunWithActivation, NEFullyConnectedLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine( |
| 256 | combine(datasets::FullyConnectedLayerWithActivationDataset(), |
| 257 | FullyConnectedParameters), |
| 258 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 259 | QuantizationData), |
| 260 | ActivationFunctionsQuantizedDataset)) |
Michele Di Giorgio | 9c70037 | 2020-01-08 11:33:44 +0000 | [diff] [blame] | 261 | { |
| 262 | // Validate output |
| 263 | validate(Accessor(_target), _reference, tolerance_qasymm8_signed); |
| 264 | } |
| 265 | TEST_SUITE_END() |
Giorgio Arena | a855af1 | 2018-07-16 17:20:38 +0100 | [diff] [blame] | 266 | TEST_SUITE_END() |
| 267 | |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 268 | TEST_SUITE_END() |
| 269 | TEST_SUITE_END() |
| 270 | } // namespace validation |
| 271 | } // namespace test |
| 272 | } // namespace arm_compute |