Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 1 | /* |
Giorgio Arena | 5d75d4a | 2021-04-15 12:54:53 +0100 | [diff] [blame^] | 2 | * Copyright (c) 2017-2021 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/CL/CLTensor.h" |
| 26 | #include "arm_compute/runtime/CL/CLTensorAllocator.h" |
| 27 | #include "arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h" |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 28 | #include "tests/CL/CLAccessor.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.05f); /**< Relative tolerance value for comparing reference's output against implementation's output for DataType:F32 */ |
| 47 | constexpr AbsoluteTolerance<float> abs_tolerance_f32(0.0001f); /**< Absolute tolerance value for comparing reference's output against implementation's output for DataType::F32 */ |
| 48 | RelativeTolerance<half_float::half> tolerance_f16(half(0.2)); /**< Relative tolerance value for comparing reference's output against implementation's output for DataType::F16 */ |
| 49 | constexpr float tolerance_num = 0.07f; /**< Tolerance number */ |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 50 | |
Georgios Pinitas | 45bcc3a | 2017-11-29 11:06:49 +0000 | [diff] [blame] | 51 | /** Tolerance for quantized asymmetric operations */ |
| 52 | constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1); |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 53 | |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 54 | const auto FullyConnectedParameters = combine(framework::dataset::make("TransposeWeights", { false, true }), framework::dataset::make("ReshapeWeights", { false, true })); |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 55 | |
| 56 | const auto QuantizationData = framework::dataset::make("QuantizationInfo", |
| 57 | { |
| 58 | QuantizationInfo(1.f / 255.f, 10), |
| 59 | QuantizationInfo(1.1f, 10), |
| 60 | }); |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 61 | |
| 62 | const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo", |
| 63 | { |
| 64 | ActivationLayerInfo(), |
| 65 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 66 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 0.5f), |
| 67 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 0.75f, 0.25f), |
| 68 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH) |
| 69 | }); |
| 70 | |
Giorgio Arena | 5d75d4a | 2021-04-15 12:54:53 +0100 | [diff] [blame^] | 71 | const auto ActivationFunctionsQuantizedDataset = concat(concat(concat( |
| 72 | framework::dataset::make("ActivationInfo", ActivationLayerInfo()), |
| 73 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))), |
| 74 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 0.5f))), |
| 75 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 0.75f, 0.25f))); |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 76 | } // namespace |
| 77 | |
| 78 | TEST_SUITE(CL) |
| 79 | TEST_SUITE(FullyConnectedLayer) |
| 80 | |
Georgios Pinitas | 358ca20 | 2017-12-07 16:47:52 +0000 | [diff] [blame] | 81 | // *INDENT-OFF* |
| 82 | // clang-format off |
| 83 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip( |
| 84 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(9U, 5U, 7U, 3U), 1, DataType::F32), // Mismatching data types |
Georgios Pinitas | 358ca20 | 2017-12-07 16:47:52 +0000 | [diff] [blame] | 85 | TensorInfo(TensorShape(8U, 4U, 6U, 4U), 1, DataType::F32), |
| 86 | TensorInfo(TensorShape(8U, 4U, 6U, 4U), 1, DataType::F32), |
| 87 | TensorInfo(TensorShape(9U, 5U, 7U, 3U), 1, DataType::F32), // Invalid weights dimensions |
| 88 | TensorInfo(TensorShape(9U, 5U, 7U, 3U), 1, DataType::F32), // Wrongly reshaped weights |
Georgios Pinitas | 358ca20 | 2017-12-07 16:47:52 +0000 | [diff] [blame] | 89 | }), |
| 90 | framework::dataset::make("WeightsInfo",{ TensorInfo(TensorShape(315U, 271U), 1, DataType::F16), |
Georgios Pinitas | 358ca20 | 2017-12-07 16:47:52 +0000 | [diff] [blame] | 91 | TensorInfo(TensorShape(192U, 192U), 1, DataType::F32), |
| 92 | TensorInfo(TensorShape(192U, 192U), 1, DataType::F32), |
Michalis Spyrou | d466c2d | 2018-01-30 10:54:39 +0000 | [diff] [blame] | 93 | TensorInfo(TensorShape(217U, 231U), 1, DataType::F32), |
Georgios Pinitas | 358ca20 | 2017-12-07 16:47:52 +0000 | [diff] [blame] | 94 | TensorInfo(TensorShape(217U, 315U), 1, DataType::F32), |
Georgios Pinitas | 358ca20 | 2017-12-07 16:47:52 +0000 | [diff] [blame] | 95 | })), |
| 96 | framework::dataset::make("BiasInfo",{ TensorInfo(TensorShape(271U), 1, DataType::F32), |
Georgios Pinitas | 358ca20 | 2017-12-07 16:47:52 +0000 | [diff] [blame] | 97 | TensorInfo(TensorShape(192U), 1, DataType::F32), |
| 98 | TensorInfo(TensorShape(192U), 1, DataType::F32), |
| 99 | TensorInfo(TensorShape(271U), 1, DataType::F32), |
| 100 | TensorInfo(TensorShape(271U), 1, DataType::F32), |
Georgios Pinitas | 358ca20 | 2017-12-07 16:47:52 +0000 | [diff] [blame] | 101 | })), |
| 102 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(271U, 3U), 1, DataType::F32), |
Georgios Pinitas | 358ca20 | 2017-12-07 16:47:52 +0000 | [diff] [blame] | 103 | TensorInfo(TensorShape(192U, 4U), 1, DataType::F32), |
| 104 | TensorInfo(TensorShape(192U, 4U), 1, DataType::F32), |
| 105 | TensorInfo(TensorShape(271U, 3U), 1, DataType::F32), |
| 106 | TensorInfo(TensorShape(271U, 3U), 1, DataType::F32), |
Georgios Pinitas | 358ca20 | 2017-12-07 16:47:52 +0000 | [diff] [blame] | 107 | })), |
Vidhya Sudhan Loganathan | 0fc2545 | 2018-06-18 14:40:56 +0100 | [diff] [blame] | 108 | framework::dataset::make("TransposeWeights",{ true, true, false, true, true })), |
| 109 | framework::dataset::make("ReshapedWeights",{ false, false, false, false, false})), |
| 110 | framework::dataset::make("Expected", { false, true, true, false, false })), |
Georgios Pinitas | 358ca20 | 2017-12-07 16:47:52 +0000 | [diff] [blame] | 111 | input_info, weights_info, bias_info, output_info, transpose_weights, reshaped_weights, expected) |
| 112 | { |
Georgios Pinitas | 7d66a8e | 2018-07-17 12:28:42 +0100 | [diff] [blame] | 113 | // Create Fully Connected layer info |
| 114 | FullyConnectedLayerInfo fc_info; |
| 115 | fc_info.transpose_weights = transpose_weights; |
| 116 | fc_info.are_weights_reshaped = reshaped_weights; |
| 117 | |
Georgios Pinitas | 358ca20 | 2017-12-07 16:47:52 +0000 | [diff] [blame] | 118 | Status status = CLFullyConnectedLayer::validate(&input_info.clone()->set_is_resizable(false), |
| 119 | &weights_info.clone()->set_is_resizable(false), |
| 120 | &bias_info.clone()->set_is_resizable(false), |
| 121 | &output_info.clone()->set_is_resizable(false), |
Georgios Pinitas | 7d66a8e | 2018-07-17 12:28:42 +0100 | [diff] [blame] | 122 | fc_info); |
Georgios Pinitas | 358ca20 | 2017-12-07 16:47:52 +0000 | [diff] [blame] | 123 | ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS); |
| 124 | } |
| 125 | // clang-format on |
| 126 | // *INDENT-ON* |
| 127 | |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 128 | template <typename T> |
Giorgio Arena | a855af1 | 2018-07-16 17:20:38 +0100 | [diff] [blame] | 129 | using CLFullyConnectedLayerFixture = FullyConnectedLayerValidationFixture<CLTensor, CLAccessor, CLFullyConnectedLayer, T>; |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 130 | template <typename T> |
| 131 | using CLFullyConnectedLayerMixedDataLayoutFixture = FullyConnectedLayerValidationFixture<CLTensor, CLAccessor, CLFullyConnectedLayer, T, true>; |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 132 | |
| 133 | TEST_SUITE(Float) |
| 134 | TEST_SUITE(FP16) |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 135 | FIXTURE_DATA_TEST_CASE(RunSmall, CLFullyConnectedLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallFullyConnectedLayerDataset(), |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 136 | FullyConnectedParameters), |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 137 | framework::dataset::make("DataType", DataType::F16)), |
| 138 | ActivationFunctionsDataset)) |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 139 | { |
| 140 | // Validate output |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 141 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 142 | } |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 143 | FIXTURE_DATA_TEST_CASE(RunLarge, CLFullyConnectedLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeFullyConnectedLayerDataset(), |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 144 | FullyConnectedParameters), |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 145 | framework::dataset::make("DataType", DataType::F16)), |
| 146 | ActivationFunctionsDataset)) |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 147 | { |
| 148 | // Validate output |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 149 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 150 | } |
| 151 | TEST_SUITE_END() |
| 152 | |
| 153 | TEST_SUITE(FP32) |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 154 | FIXTURE_DATA_TEST_CASE(RunSmall, CLFullyConnectedLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallFullyConnectedLayerDataset(), FullyConnectedParameters), |
| 155 | framework::dataset::make("DataType", DataType::F32)), |
| 156 | ActivationFunctionsDataset)) |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 157 | { |
| 158 | // Validate output |
Michele Di Giorgio | 419f33a | 2018-08-27 14:25:24 +0100 | [diff] [blame] | 159 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0, abs_tolerance_f32); |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 160 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 161 | FIXTURE_DATA_TEST_CASE(RunMixedDataLayout, CLFullyConnectedLayerMixedDataLayoutFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine( |
Giorgio Arena | 5d75d4a | 2021-04-15 12:54:53 +0100 | [diff] [blame^] | 162 | framework::dataset::make("Input", TensorShape(9U, 5U, 7U)), |
| 163 | framework::dataset::make("Weights", TensorShape(315U, 271U))), |
| 164 | framework::dataset::make("Biases", TensorShape(271U))), |
| 165 | framework::dataset::make("Output", TensorShape(271U))), |
| 166 | FullyConnectedParameters), |
| 167 | framework::dataset::make("DataType", DataType::F32)), |
| 168 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)))) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 169 | { |
| 170 | // Validate output |
| 171 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0, abs_tolerance_f32); |
| 172 | } |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 173 | FIXTURE_DATA_TEST_CASE(RunLarge, CLFullyConnectedLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeFullyConnectedLayerDataset(), FullyConnectedParameters), |
| 174 | framework::dataset::make("DataType", DataType::F32)), |
| 175 | ActivationFunctionsDataset)) |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 176 | { |
| 177 | // Validate output |
Michele Di Giorgio | 419f33a | 2018-08-27 14:25:24 +0100 | [diff] [blame] | 178 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0, abs_tolerance_f32); |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 179 | } |
| 180 | TEST_SUITE_END() |
| 181 | TEST_SUITE_END() |
| 182 | |
| 183 | template <typename T> |
Giorgio Arena | a855af1 | 2018-07-16 17:20:38 +0100 | [diff] [blame] | 184 | using CLFullyConnectedLayerQuantizedFixture = FullyConnectedLayerValidationQuantizedFixture<CLTensor, CLAccessor, CLFullyConnectedLayer, T>; |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 185 | template <typename T> |
| 186 | using CLFullyConnectedLayerQuantizedMixedDataLayoutFixture = FullyConnectedLayerValidationQuantizedFixture<CLTensor, CLAccessor, CLFullyConnectedLayer, T, true>; |
Georgios Pinitas | 45bcc3a | 2017-11-29 11:06:49 +0000 | [diff] [blame] | 187 | |
| 188 | TEST_SUITE(Quantized) |
| 189 | TEST_SUITE(QASYMM8) |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 190 | FIXTURE_DATA_TEST_CASE(RunSmall, CLFullyConnectedLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 191 | combine(combine(combine(combine(datasets::SmallFullyConnectedLayerDataset(), FullyConnectedParameters), framework::dataset::make("DataType", DataType::QASYMM8)), QuantizationData), |
| 192 | ActivationFunctionsQuantizedDataset)) |
Georgios Pinitas | 45bcc3a | 2017-11-29 11:06:49 +0000 | [diff] [blame] | 193 | { |
| 194 | // Validate output |
| 195 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 196 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 197 | FIXTURE_DATA_TEST_CASE(RunMixedDataLayout, CLFullyConnectedLayerQuantizedMixedDataLayoutFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 198 | combine(combine(combine(combine(combine(combine(combine( |
Giorgio Arena | 5d75d4a | 2021-04-15 12:54:53 +0100 | [diff] [blame^] | 199 | framework::dataset::make("Input", TensorShape(9U, 5U, 7U)), |
| 200 | framework::dataset::make("Weights", TensorShape(315U, 271U))), |
| 201 | framework::dataset::make("Biases", TensorShape(271U))), |
| 202 | framework::dataset::make("Output", TensorShape(271U))), |
| 203 | FullyConnectedParameters), |
| 204 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 205 | QuantizationData), |
| 206 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)))) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 207 | { |
| 208 | // Validate output |
| 209 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 210 | } |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 211 | FIXTURE_DATA_TEST_CASE(RunLarge, CLFullyConnectedLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 212 | combine(combine(combine(combine(datasets::LargeFullyConnectedLayerDataset(), FullyConnectedParameters), framework::dataset::make("DataType", DataType::QASYMM8)), QuantizationData), |
| 213 | ActivationFunctionsQuantizedDataset)) |
Georgios Pinitas | 45bcc3a | 2017-11-29 11:06:49 +0000 | [diff] [blame] | 214 | { |
| 215 | // Validate output |
| 216 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 217 | } |
Sang-Hoon Park | b66aa3b | 2020-01-10 14:44:13 +0000 | [diff] [blame] | 218 | TEST_SUITE_END() /* QASYMM8 */ |
| 219 | TEST_SUITE(QASYMM8_SIGNED) |
| 220 | FIXTURE_DATA_TEST_CASE(RunSmall, CLFullyConnectedLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 221 | combine(combine(combine(combine(datasets::SmallFullyConnectedLayerDataset(), FullyConnectedParameters), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), QuantizationData), |
| 222 | ActivationFunctionsQuantizedDataset)) |
Sang-Hoon Park | b66aa3b | 2020-01-10 14:44:13 +0000 | [diff] [blame] | 223 | { |
| 224 | // Validate output |
| 225 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 226 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 227 | FIXTURE_DATA_TEST_CASE(RunMixedDataLayout, CLFullyConnectedLayerQuantizedMixedDataLayoutFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 228 | combine(combine(combine(combine(combine(combine(combine( |
Giorgio Arena | 5d75d4a | 2021-04-15 12:54:53 +0100 | [diff] [blame^] | 229 | framework::dataset::make("Input", TensorShape(9U, 5U, 7U)), |
| 230 | framework::dataset::make("Weights", TensorShape(315U, 271U))), |
| 231 | framework::dataset::make("Biases", TensorShape(271U))), |
| 232 | framework::dataset::make("Output", TensorShape(271U))), |
| 233 | FullyConnectedParameters), |
| 234 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 235 | QuantizationData), |
| 236 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)))) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 237 | { |
| 238 | // Validate output |
| 239 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 240 | } |
| 241 | TEST_SUITE_END() // QASYMM8_SIGNED |
| 242 | TEST_SUITE_END() // Quantized |
| 243 | TEST_SUITE_END() // FullyConnectedLayer |
| 244 | TEST_SUITE_END() // CL |
Moritz Pflanzer | 69d3341 | 2017-08-09 11:45:15 +0100 | [diff] [blame] | 245 | } // namespace validation |
| 246 | } // namespace test |
| 247 | } // namespace arm_compute |