Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 1 | /* |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2019 ARM Limited. |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +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/CLBatchNormalizationLayer.h" |
Georgios Pinitas | c936917 | 2018-09-26 11:25:40 +0100 | [diff] [blame] | 28 | #include "arm_compute/runtime/CL/functions/CLConvolutionLayer.h" |
| 29 | #include "arm_compute/runtime/CL/functions/CLFuseBatchNormalization.h" |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 30 | #include "tests/CL/CLAccessor.h" |
| 31 | #include "tests/PaddingCalculator.h" |
Georgios Pinitas | c936917 | 2018-09-26 11:25:40 +0100 | [diff] [blame] | 32 | #include "tests/datasets/LargeConvolutionLayerDataset.h" |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 33 | #include "tests/datasets/RandomBatchNormalizationLayerDataset.h" |
Georgios Pinitas | c936917 | 2018-09-26 11:25:40 +0100 | [diff] [blame] | 34 | #include "tests/datasets/SmallConvolutionLayerDataset.h" |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 35 | #include "tests/framework/Asserts.h" |
| 36 | #include "tests/framework/Macros.h" |
| 37 | #include "tests/framework/datasets/Datasets.h" |
Michele Di Giorgio | 0cbb927 | 2018-03-01 16:56:48 +0000 | [diff] [blame] | 38 | #include "tests/validation/Helpers.h" |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 39 | #include "tests/validation/Validation.h" |
| 40 | #include "tests/validation/fixtures/BatchNormalizationLayerFixture.h" |
Georgios Pinitas | c936917 | 2018-09-26 11:25:40 +0100 | [diff] [blame] | 41 | #include "tests/validation/fixtures/BatchNormalizationLayerFusionFixture.h" |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 42 | |
| 43 | namespace arm_compute |
| 44 | { |
| 45 | namespace test |
| 46 | { |
| 47 | namespace validation |
| 48 | { |
| 49 | namespace |
| 50 | { |
Georgios Pinitas | 51e53a3 | 2018-10-22 13:49:08 +0100 | [diff] [blame] | 51 | RelativeTolerance<float> rel_tolerance_f32(0.05f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */ |
| 52 | constexpr AbsoluteTolerance<float> abs_tolerance_f32(0.0001f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */ |
| 53 | constexpr AbsoluteTolerance<float> tolerance_f16(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */ |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 54 | const auto act_infos = framework::dataset::make("ActivationInfo", |
| 55 | { |
| 56 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 57 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f), |
| 58 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 8.f, 2.f), |
| 59 | }); |
Georgios Pinitas | c936917 | 2018-09-26 11:25:40 +0100 | [diff] [blame] | 60 | |
| 61 | const auto common_fusion_dataset = combine(combine(combine(framework::dataset::make("UseBias", { false, true }), |
| 62 | framework::dataset::make("UseBeta", { false, true })), |
| 63 | framework::dataset::make("UseGamma", { false, true })), |
| 64 | framework::dataset::make("Epsilon", { 0.001f })); |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 65 | } // namespace |
| 66 | |
| 67 | TEST_SUITE(CL) |
| 68 | TEST_SUITE(BatchNormalizationLayer) |
| 69 | |
| 70 | template <typename T> |
| 71 | using CLBatchNormalizationLayerFixture = BatchNormalizationLayerValidationFixture<CLTensor, CLAccessor, CLBatchNormalizationLayer, T>; |
| 72 | |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 73 | DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallRandomBatchNormalizationLayerDataset(), |
Michele Di Giorgio | 0cbb927 | 2018-03-01 16:56:48 +0000 | [diff] [blame] | 74 | combine(framework::dataset::make("UseBeta", { false, true }), |
| 75 | framework::dataset::make("UseGamma", { false, true }))), |
Vidhya Sudhan Loganathan | 0fc2545 | 2018-06-18 14:40:56 +0100 | [diff] [blame] | 76 | framework::dataset::make("DataType", { DataType::F16, DataType::F32 })), |
Michele Di Giorgio | bf3c662 | 2018-03-08 11:52:27 +0000 | [diff] [blame] | 77 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Michele Di Giorgio | 0cbb927 | 2018-03-01 16:56:48 +0000 | [diff] [blame] | 78 | shape0, shape1, epsilon, use_gamma, use_beta, dt, data_layout) |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 79 | { |
Michele Di Giorgio | 0cbb927 | 2018-03-01 16:56:48 +0000 | [diff] [blame] | 80 | TensorShape src_dst_shapes = shape0; |
| 81 | if(data_layout == DataLayout::NHWC) |
| 82 | { |
| 83 | permute(src_dst_shapes, PermutationVector(2U, 0U, 1U)); |
| 84 | } |
| 85 | |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 86 | // Create tensors |
Vidhya Sudhan Loganathan | 014333d | 2018-07-02 09:13:49 +0100 | [diff] [blame] | 87 | CLTensor src = create_tensor<CLTensor>(src_dst_shapes, dt, 1, QuantizationInfo(), data_layout); |
| 88 | CLTensor dst = create_tensor<CLTensor>(src_dst_shapes, dt, 1, QuantizationInfo(), data_layout); |
| 89 | CLTensor mean = create_tensor<CLTensor>(shape1, dt, 1); |
| 90 | CLTensor var = create_tensor<CLTensor>(shape1, dt, 1); |
| 91 | CLTensor beta = create_tensor<CLTensor>(shape1, dt, 1); |
| 92 | CLTensor gamma = create_tensor<CLTensor>(shape1, dt, 1); |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 93 | |
| 94 | // Create and Configure function |
| 95 | CLBatchNormalizationLayer norm; |
Michele Di Giorgio | 4d33630 | 2018-03-02 09:43:54 +0000 | [diff] [blame] | 96 | CLTensor *beta_ptr = use_beta ? &beta : nullptr; |
| 97 | CLTensor *gamma_ptr = use_gamma ? &gamma : nullptr; |
| 98 | norm.configure(&src, &dst, &mean, &var, beta_ptr, gamma_ptr, epsilon); |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 99 | |
| 100 | // Validate valid region |
Michele Di Giorgio | 0cbb927 | 2018-03-01 16:56:48 +0000 | [diff] [blame] | 101 | const ValidRegion valid_region = shape_to_valid_region(src_dst_shapes); |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 102 | validate(dst.info()->valid_region(), valid_region); |
| 103 | } |
| 104 | |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 105 | // *INDENT-OFF* |
| 106 | // clang-format off |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 107 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 108 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), |
| 109 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Window shrink |
| 110 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), // Mismatching data types |
| 111 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), // Mismatching data types |
| 112 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), // Invalid mean/var/beta/gamma shape |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 113 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), // Unsupported fused activation |
| 114 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), // Fused activation's a < b |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 115 | }), |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 116 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 117 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 118 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), |
| 119 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F16), |
| 120 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 121 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), |
| 122 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 123 | })), |
| 124 | framework::dataset::make("MVBGInfo",{ TensorInfo(TensorShape(2U), 1, DataType::F32), |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 125 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 126 | TensorInfo(TensorShape(2U), 1, DataType::F16), |
| 127 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 128 | TensorInfo(TensorShape(5U), 1, DataType::F32), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 129 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 130 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 131 | })), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 132 | framework::dataset::make("ActivationLayerInfo",{ ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 133 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 134 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f), |
| 135 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f), |
| 136 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 6.f), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 137 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), |
| 138 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 2.f, 6.f), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 139 | })), |
Vidhya Sudhan Loganathan | 0fc2545 | 2018-06-18 14:40:56 +0100 | [diff] [blame] | 140 | framework::dataset::make("Expected", { true, false, false, false, false, false, false})), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 141 | input_info, output_info, mvbg_info, act_info, expected) |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 142 | { |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 143 | const auto &mean_info = mvbg_info; |
| 144 | const auto &var_info = mvbg_info; |
| 145 | const auto &beta_info = mvbg_info; |
| 146 | const auto &gamma_info = mvbg_info; |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 147 | bool has_error = bool(CLBatchNormalizationLayer::validate(&input_info.clone()->set_is_resizable(false), (output_info.total_size() == 0) ? nullptr : &output_info.clone()->set_is_resizable(false), &mean_info.clone()->set_is_resizable(false), &var_info.clone()->set_is_resizable(false), &beta_info.clone()->set_is_resizable(false), &gamma_info.clone()->set_is_resizable(false), 1.f, act_info)); |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 148 | ARM_COMPUTE_EXPECT(has_error == expected, framework::LogLevel::ERRORS); |
| 149 | } |
| 150 | // clang-format on |
| 151 | // *INDENT-ON* |
| 152 | |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 153 | TEST_SUITE(Float) |
Gian Marco Iodice | 349feef | 2017-09-28 11:21:29 +0100 | [diff] [blame] | 154 | TEST_SUITE(FP32) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 155 | FIXTURE_DATA_TEST_CASE(Random, CLBatchNormalizationLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallRandomBatchNormalizationLayerDataset(), |
Michele Di Giorgio | 4d33630 | 2018-03-02 09:43:54 +0000 | [diff] [blame] | 156 | combine(framework::dataset::make("UseBeta", { false, true }), |
| 157 | framework::dataset::make("UseGamma", { false, true }))), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 158 | act_infos), |
Michele Di Giorgio | 0cbb927 | 2018-03-01 16:56:48 +0000 | [diff] [blame] | 159 | framework::dataset::make("DataType", DataType::F32)), |
Michele Di Giorgio | bf3c662 | 2018-03-08 11:52:27 +0000 | [diff] [blame] | 160 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 161 | { |
| 162 | // Validate output |
Georgios Pinitas | c936917 | 2018-09-26 11:25:40 +0100 | [diff] [blame] | 163 | validate(CLAccessor(_target), _reference, abs_tolerance_f32, 0); |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 164 | } |
Georgios Pinitas | c936917 | 2018-09-26 11:25:40 +0100 | [diff] [blame] | 165 | TEST_SUITE_END() //FP32 |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 166 | |
Gian Marco Iodice | 349feef | 2017-09-28 11:21:29 +0100 | [diff] [blame] | 167 | TEST_SUITE(FP16) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 168 | FIXTURE_DATA_TEST_CASE(Random, CLBatchNormalizationLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallRandomBatchNormalizationLayerDataset(), |
Michele Di Giorgio | 4d33630 | 2018-03-02 09:43:54 +0000 | [diff] [blame] | 169 | combine(framework::dataset::make("UseBeta", { false, true }), |
| 170 | framework::dataset::make("UseGamma", { false, true }))), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 171 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f))), |
Michele Di Giorgio | 0cbb927 | 2018-03-01 16:56:48 +0000 | [diff] [blame] | 172 | framework::dataset::make("DataType", DataType::F16)), |
Michele Di Giorgio | bf3c662 | 2018-03-08 11:52:27 +0000 | [diff] [blame] | 173 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | 349feef | 2017-09-28 11:21:29 +0100 | [diff] [blame] | 174 | { |
| 175 | // Validate output |
| 176 | validate(CLAccessor(_target), _reference, tolerance_f16, 0); |
| 177 | } |
Georgios Pinitas | c936917 | 2018-09-26 11:25:40 +0100 | [diff] [blame] | 178 | TEST_SUITE_END() // FP16 |
| 179 | TEST_SUITE_END() // Float |
Gian Marco Iodice | 349feef | 2017-09-28 11:21:29 +0100 | [diff] [blame] | 180 | |
Georgios Pinitas | c936917 | 2018-09-26 11:25:40 +0100 | [diff] [blame] | 181 | TEST_SUITE_END() // BatchNormalizationLayer |
| 182 | |
| 183 | TEST_SUITE(BatchNormalizationLayerFusion) |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 184 | // *INDENT-OFF* |
| 185 | // clang-format off |
| 186 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip( |
| 187 | framework::dataset::make("Weights", { TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), // Valid |
| 188 | TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), // Mismatching data types |
| 189 | TensorInfo(TensorShape(32U, 13U, 2U, 1U), 1, DataType::F32), // Invalid mean/var/beta/gamma shape |
| 190 | }), |
| 191 | framework::dataset::make("MVBGInfo",{ TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 192 | TensorInfo(TensorShape(2U), 1, DataType::F16), |
| 193 | TensorInfo(TensorShape(5U), 1, DataType::F32), |
| 194 | })), |
| 195 | framework::dataset::make("Expected", { true, false, false})), |
| 196 | weights_info, mvbg_info, expected) |
| 197 | { |
| 198 | const auto &weights_in_info = weights_info; |
| 199 | const auto &mean_info = mvbg_info; |
| 200 | const auto &var_info = mvbg_info; |
| 201 | const auto &fused_weights_info = weights_info; |
| 202 | const auto &fused_bias_info = mvbg_info; |
| 203 | const auto &conv_bias_info = mvbg_info; |
| 204 | const auto &beta_info = mvbg_info; |
| 205 | const auto &gamma_info = mvbg_info; |
| 206 | bool has_error = bool(CLFuseBatchNormalization::validate( |
| 207 | &weights_in_info.clone()->set_is_resizable(false), &mean_info.clone()->set_is_resizable(false), |
| 208 | &var_info.clone()->set_is_resizable(false), &fused_weights_info.clone()->set_is_resizable(false), |
| 209 | &fused_bias_info.clone()->set_is_resizable(false), &conv_bias_info.clone()->set_is_resizable(false), |
| 210 | &beta_info.clone()->set_is_resizable(false), &gamma_info.clone()->set_is_resizable(false), 1.f)); |
| 211 | ARM_COMPUTE_EXPECT(has_error == expected, framework::LogLevel::ERRORS); |
| 212 | } |
| 213 | // clang-format on |
| 214 | // *INDENT-ON* |
Georgios Pinitas | c936917 | 2018-09-26 11:25:40 +0100 | [diff] [blame] | 215 | template <typename T> |
| 216 | using CLBatchNormalizationLayerFusionFixture = BatchNormalizationLayerFusionValidationFixture<CLTensor, CLAccessor, CLConvolutionLayer, CLFuseBatchNormalization, T>; |
| 217 | |
| 218 | TEST_SUITE(Float) |
| 219 | TEST_SUITE(FP32) |
| 220 | FIXTURE_DATA_TEST_CASE(RunSmall, CLBatchNormalizationLayerFusionFixture<float>, framework::DatasetMode::PRECOMMIT, |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 221 | combine(combine(combine(datasets::SmallConvolutionLayerReducedDataset(), common_fusion_dataset), |
| 222 | framework::dataset::make("DataType", DataType::F32)), |
| 223 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 224 | { |
| 225 | // Validate output |
| 226 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 227 | } |
| 228 | FIXTURE_DATA_TEST_CASE(RunLarge, CLBatchNormalizationLayerFusionFixture<float>, framework::DatasetMode::NIGHTLY, |
Georgios Pinitas | c936917 | 2018-09-26 11:25:40 +0100 | [diff] [blame] | 229 | combine(combine(combine(datasets::SmallConvolutionLayerDataset(), common_fusion_dataset), |
| 230 | framework::dataset::make("DataType", DataType::F32)), |
| 231 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 232 | { |
| 233 | // Validate output |
| 234 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 235 | } |
| 236 | TEST_SUITE_END() // FP32 |
| 237 | TEST_SUITE_END() // Float |
| 238 | |
| 239 | TEST_SUITE_END() // BatchNormalizationLayerFusion |
| 240 | TEST_SUITE_END() // CL |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 241 | } // namespace validation |
| 242 | } // namespace test |
| 243 | } // namespace arm_compute |