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/NEON/functions/NEBatchNormalizationLayer.h" |
giuros01 | 15ecc9a | 2018-12-06 10:47:34 +0000 | [diff] [blame] | 26 | #include "arm_compute/runtime/NEON/functions/NEConvolutionLayer.h" |
| 27 | #include "arm_compute/runtime/NEON/functions/NEFuseBatchNormalization.h" |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 28 | #include "arm_compute/runtime/Tensor.h" |
| 29 | #include "arm_compute/runtime/TensorAllocator.h" |
| 30 | #include "tests/NEON/Accessor.h" |
| 31 | #include "tests/PaddingCalculator.h" |
| 32 | #include "tests/datasets/RandomBatchNormalizationLayerDataset.h" |
| 33 | #include "tests/datasets/ShapeDatasets.h" |
giuros01 | 15ecc9a | 2018-12-06 10:47:34 +0000 | [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" |
giuros01 | 15ecc9a | 2018-12-06 10:47:34 +0000 | [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 | { |
giuros01 | 15ecc9a | 2018-12-06 10:47:34 +0000 | [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 */ |
Ioan-Cristian Szabo | 5edbd1c | 2017-11-13 13:34:08 +0000 | [diff] [blame] | 53 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 54 | constexpr AbsoluteTolerance<float> tolerance_f16(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */ |
giuros01 | 15ecc9a | 2018-12-06 10:47:34 +0000 | [diff] [blame] | 55 | #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Vidhya Sudhan Loganathan | 0fc2545 | 2018-06-18 14:40:56 +0100 | [diff] [blame] | 56 | const auto act_infos = framework::dataset::make("ActivationInfo", |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 57 | { |
| 58 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 59 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f), |
| 60 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 8.f, 2.f), |
| 61 | }); |
giuros01 | 15ecc9a | 2018-12-06 10:47:34 +0000 | [diff] [blame] | 62 | const auto common_fusion_dataset = combine(combine(combine(framework::dataset::make("UseBias", { false, true }), |
| 63 | framework::dataset::make("UseBeta", { false, true })), |
| 64 | framework::dataset::make("UseGamma", { false, true })), |
| 65 | framework::dataset::make("Epsilon", { 0.001f })); |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 66 | } // namespace |
| 67 | |
| 68 | TEST_SUITE(NEON) |
| 69 | TEST_SUITE(BatchNormalizationLayer) |
| 70 | |
| 71 | template <typename T> |
| 72 | using NEBatchNormalizationLayerFixture = BatchNormalizationLayerValidationFixture<Tensor, Accessor, NEBatchNormalizationLayer, T>; |
| 73 | |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 74 | 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] | 75 | combine(framework::dataset::make("UseBeta", { false, true }), 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::F32 })), |
Michele Di Giorgio | 0cbb927 | 2018-03-01 16:56:48 +0000 | [diff] [blame] | 77 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 78 | shape0, shape1, epsilon, use_beta, use_gamma, 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 | Tensor src = create_tensor<Tensor>(src_dst_shapes, dt, 1, QuantizationInfo(), data_layout); |
| 88 | Tensor dst = create_tensor<Tensor>(src_dst_shapes, dt, 1, QuantizationInfo(), data_layout); |
| 89 | Tensor mean = create_tensor<Tensor>(shape1, dt, 1); |
| 90 | Tensor var = create_tensor<Tensor>(shape1, dt, 1); |
| 91 | Tensor beta = create_tensor<Tensor>(shape1, dt, 1); |
| 92 | Tensor gamma = create_tensor<Tensor>(shape1, dt, 1); |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 93 | |
| 94 | // Create and Configure function |
| 95 | NEBatchNormalizationLayer norm; |
Michele Di Giorgio | 4d33630 | 2018-03-02 09:43:54 +0000 | [diff] [blame] | 96 | Tensor *beta_ptr = use_beta ? &beta : nullptr; |
| 97 | Tensor *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 | |
Ioan-Cristian Szabo | 303be90 | 2017-11-27 16:31:10 +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( |
Ioan-Cristian Szabo | 303be90 | 2017-11-27 16:31: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), // Fused activation's a < b |
Ioan-Cristian Szabo | 303be90 | 2017-11-27 16:31:10 +0000 | [diff] [blame] | 114 | }), |
| 115 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), |
| 116 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), |
| 117 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), |
| 118 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F16), |
| 119 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 120 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), |
Ioan-Cristian Szabo | 303be90 | 2017-11-27 16:31:10 +0000 | [diff] [blame] | 121 | })), |
| 122 | framework::dataset::make("MVBGInfo",{ TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 123 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 124 | TensorInfo(TensorShape(2U), 1, DataType::F16), |
| 125 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 126 | TensorInfo(TensorShape(5U), 1, DataType::F32), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 127 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
Ioan-Cristian Szabo | 303be90 | 2017-11-27 16:31:10 +0000 | [diff] [blame] | 128 | })), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 129 | framework::dataset::make("ActivationLayerInfo",{ ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 130 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 131 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f), |
| 132 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f), |
| 133 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 6.f), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 134 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 2.f, 6.f), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 135 | })), |
Vidhya Sudhan Loganathan | 0fc2545 | 2018-06-18 14:40:56 +0100 | [diff] [blame] | 136 | framework::dataset::make("Expected", { true, false, false, false, false, false})), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 137 | input_info, output_info, mvbg_info, act_info, expected) |
Ioan-Cristian Szabo | 303be90 | 2017-11-27 16:31:10 +0000 | [diff] [blame] | 138 | { |
| 139 | const auto &mean_info = mvbg_info; |
| 140 | const auto &var_info = mvbg_info; |
| 141 | const auto &beta_info = mvbg_info; |
| 142 | const auto &gamma_info = mvbg_info; |
| 143 | bool has_error = bool(NEBatchNormalizationLayer::validate( |
| 144 | &input_info.clone()->set_is_resizable(false), output_info.total_size() ? &output_info.clone()->set_is_resizable(false) : nullptr, |
| 145 | &mean_info.clone()->set_is_resizable(false), &var_info.clone()->set_is_resizable(false), |
Giorgio Arena | 1167487 | 2018-02-07 15:38:12 +0000 | [diff] [blame] | 146 | &beta_info.clone()->set_is_resizable(false), &gamma_info.clone()->set_is_resizable(false), 1.f, act_info)); |
Ioan-Cristian Szabo | 303be90 | 2017-11-27 16:31:10 +0000 | [diff] [blame] | 147 | ARM_COMPUTE_EXPECT(has_error == expected, framework::LogLevel::ERRORS); |
| 148 | } |
| 149 | // clang-format on |
| 150 | // *INDENT-ON* |
| 151 | |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 152 | TEST_SUITE(Float) |
Michele Di Giorgio | 0cbb927 | 2018-03-01 16:56:48 +0000 | [diff] [blame] | 153 | TEST_SUITE(FP32) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 154 | FIXTURE_DATA_TEST_CASE(RandomSmall, NEBatchNormalizationLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallRandomBatchNormalizationLayerDataset(), |
| 155 | combine(framework::dataset::make("UseBeta", { false, true }), |
| 156 | framework::dataset::make("UseGamma", { false, true }))), |
| 157 | act_infos), |
| 158 | framework::dataset::make("DataType", DataType::F32)), |
| 159 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 160 | { |
| 161 | // Validate output |
giuros01 | 15ecc9a | 2018-12-06 10:47:34 +0000 | [diff] [blame] | 162 | validate(Accessor(_target), _reference, abs_tolerance_f32, 0); |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 163 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 164 | FIXTURE_DATA_TEST_CASE(RandomLarge, NEBatchNormalizationLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeRandomBatchNormalizationLayerDataset(), |
| 165 | combine(framework::dataset::make("UseBeta", { false, true }), |
| 166 | framework::dataset::make("UseGamma", { false, true }))), |
| 167 | act_infos), |
| 168 | framework::dataset::make("DataType", DataType::F32)), |
| 169 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 170 | { |
| 171 | // Validate output |
| 172 | validate(Accessor(_target), _reference, abs_tolerance_f32, 0); |
| 173 | } |
| 174 | TEST_SUITE_END() // F32 |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 175 | |
Ioan-Cristian Szabo | 5edbd1c | 2017-11-13 13:34:08 +0000 | [diff] [blame] | 176 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Michele Di Giorgio | 0cbb927 | 2018-03-01 16:56:48 +0000 | [diff] [blame] | 177 | TEST_SUITE(FP16) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 178 | FIXTURE_DATA_TEST_CASE(RandomSmall, NEBatchNormalizationLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallRandomBatchNormalizationLayerDataset(), |
| 179 | combine(framework::dataset::make("UseBeta", { false, true }), |
| 180 | framework::dataset::make("UseGamma", { false, true }))), |
| 181 | framework::dataset::make("ActivationInfo", ActivationLayerInfo())), |
| 182 | framework::dataset::make("DataType", DataType::F16)), |
| 183 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 184 | { |
| 185 | // Validate output |
| 186 | validate(Accessor(_target), _reference, tolerance_f16, 0); |
| 187 | } |
| 188 | |
| 189 | FIXTURE_DATA_TEST_CASE(RandomLarge, NEBatchNormalizationLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::LargeRandomBatchNormalizationLayerDataset(), |
| 190 | combine(framework::dataset::make("UseBeta", { false, true }), |
| 191 | framework::dataset::make("UseGamma", { false, true }))), |
| 192 | framework::dataset::make("ActivationInfo", ActivationLayerInfo())), |
| 193 | framework::dataset::make("DataType", DataType::F16)), |
| 194 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 195 | { |
| 196 | // Validate output |
| 197 | validate(Accessor(_target), _reference, tolerance_f16, 0); |
| 198 | } |
giuros01 | 15ecc9a | 2018-12-06 10:47:34 +0000 | [diff] [blame] | 199 | TEST_SUITE_END() // FP16 |
| 200 | #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */ |
| 201 | TEST_SUITE_END() // Float |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 202 | |
giuros01 | 15ecc9a | 2018-12-06 10:47:34 +0000 | [diff] [blame] | 203 | TEST_SUITE_END() // BatchNormalizationLayer |
| 204 | |
| 205 | TEST_SUITE(BatchNormalizationLayerFusion) |
| 206 | template <typename T> |
| 207 | using NEBatchNormalizationLayerFusionFixture = BatchNormalizationLayerFusionValidationFixture<Tensor, Accessor, NEConvolutionLayer, NEFuseBatchNormalization, T>; |
| 208 | |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 209 | // *INDENT-OFF* |
| 210 | // clang-format off |
| 211 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip( |
| 212 | framework::dataset::make("Weights", { TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), // Valid |
| 213 | TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), // Mismatching data types |
| 214 | TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F16), // Mismatching data types |
| 215 | TensorInfo(TensorShape(32U, 13U, 2U, 1U), 1, DataType::F32), // Invalid mean/var/beta/gamma shape |
| 216 | }), |
| 217 | framework::dataset::make("MVBGInfo",{ TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 218 | TensorInfo(TensorShape(2U), 1, DataType::F16), |
| 219 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 220 | TensorInfo(TensorShape(5U), 1, DataType::F32), |
| 221 | })), |
| 222 | framework::dataset::make("Expected", { true, false, false, false})), |
| 223 | weights_info, mvbg_info, expected) |
| 224 | { |
| 225 | const auto &weights_in_info = weights_info; |
| 226 | const auto &mean_info = mvbg_info; |
| 227 | const auto &var_info = mvbg_info; |
| 228 | const auto &fused_weights_info = weights_info; |
| 229 | const auto &fused_bias_info = mvbg_info; |
| 230 | const auto &conv_bias_info = mvbg_info; |
| 231 | const auto &beta_info = mvbg_info; |
| 232 | const auto &gamma_info = mvbg_info; |
| 233 | bool has_error = bool(NEFuseBatchNormalization::validate( |
| 234 | &weights_in_info.clone()->set_is_resizable(false), &mean_info.clone()->set_is_resizable(false), |
| 235 | &var_info.clone()->set_is_resizable(false), &fused_weights_info.clone()->set_is_resizable(false), |
| 236 | &fused_bias_info.clone()->set_is_resizable(false), &conv_bias_info.clone()->set_is_resizable(false), |
| 237 | &beta_info.clone()->set_is_resizable(false), &gamma_info.clone()->set_is_resizable(false), 1.f)); |
| 238 | ARM_COMPUTE_EXPECT(has_error == expected, framework::LogLevel::ERRORS); |
| 239 | } |
| 240 | // clang-format on |
| 241 | // *INDENT-ON* |
| 242 | |
giuros01 | 15ecc9a | 2018-12-06 10:47:34 +0000 | [diff] [blame] | 243 | TEST_SUITE(Float) |
| 244 | TEST_SUITE(FP32) |
| 245 | FIXTURE_DATA_TEST_CASE(RunSmall, NEBatchNormalizationLayerFusionFixture<float>, framework::DatasetMode::PRECOMMIT, |
| 246 | combine(combine(combine(datasets::SmallConvolutionLayerDataset(), common_fusion_dataset), |
| 247 | framework::dataset::make("DataType", DataType::F32)), |
| 248 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 249 | { |
| 250 | // Validate output |
| 251 | validate(Accessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 252 | } |
| 253 | TEST_SUITE_END() // FP32 |
| 254 | TEST_SUITE_END() // Float |
| 255 | |
| 256 | TEST_SUITE_END() // BatchNormalizationLayerFusion |
| 257 | TEST_SUITE_END() // NEON |
Sanghoon Lee | 9688378 | 2017-09-15 14:10:48 +0100 | [diff] [blame] | 258 | } // namespace validation |
| 259 | } // namespace test |
| 260 | } // namespace arm_compute |