Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 1 | /* |
Diego Lopez Recas | ff860cf | 2018-02-22 13:08:01 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2018 ARM Limited. |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +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/Helpers.h" |
| 25 | #include "arm_compute/core/Types.h" |
| 26 | #include "arm_compute/runtime/NEON/functions/NEScale.h" |
| 27 | #include "arm_compute/runtime/Tensor.h" |
| 28 | #include "arm_compute/runtime/TensorAllocator.h" |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 29 | #include "tests/NEON/Accessor.h" |
| 30 | #include "tests/PaddingCalculator.h" |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 31 | #include "tests/datasets/BorderModeDataset.h" |
| 32 | #include "tests/datasets/InterpolationPolicyDataset.h" |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 33 | #include "tests/datasets/SamplingPolicyDataset.h" |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 34 | #include "tests/datasets/ShapeDatasets.h" |
| 35 | #include "tests/framework/Asserts.h" |
| 36 | #include "tests/framework/Macros.h" |
| 37 | #include "tests/framework/datasets/Datasets.h" |
| 38 | #include "tests/validation/Helpers.h" |
| 39 | #include "tests/validation/Validation.h" |
| 40 | #include "tests/validation/fixtures/ScaleFixture.h" |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 41 | |
| 42 | namespace arm_compute |
| 43 | { |
| 44 | namespace test |
| 45 | { |
| 46 | namespace validation |
| 47 | { |
Isabella Gottardi | 732f368 | 2017-09-05 14:10:12 +0100 | [diff] [blame] | 48 | namespace |
| 49 | { |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 50 | /** Scale data types */ |
| 51 | const auto ScaleDataTypes = framework::dataset::make("DataType", |
| 52 | { |
| 53 | DataType::U8, |
| 54 | DataType::S16, |
| 55 | DataType::F32, |
| 56 | }); |
| 57 | |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 58 | /** Scale data types */ |
| 59 | const auto ScaleDataLayouts = framework::dataset::make("DataLayout", |
| 60 | { |
| 61 | DataLayout::NCHW, |
| 62 | DataLayout::NHWC, |
| 63 | }); |
| 64 | |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 65 | /** Tolerance */ |
Georgios Pinitas | 99d4f4a | 2017-09-19 16:51:42 +0100 | [diff] [blame] | 66 | constexpr AbsoluteTolerance<uint8_t> tolerance_u8(1); |
| 67 | constexpr AbsoluteTolerance<int16_t> tolerance_s16(1); |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 68 | RelativeTolerance<float> tolerance_f32(0.01); |
Moritz Pflanzer | ff1c360 | 2017-09-22 12:41:25 +0100 | [diff] [blame] | 69 | |
| 70 | constexpr float tolerance_num_s16 = 0.01f; |
| 71 | constexpr float tolerance_num_f32 = 0.01f; |
Isabella Gottardi | 732f368 | 2017-09-05 14:10:12 +0100 | [diff] [blame] | 72 | } // namespace |
| 73 | |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 74 | TEST_SUITE(NEON) |
| 75 | TEST_SUITE(Scale) |
| 76 | |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 77 | DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), ScaleDataTypes), ScaleDataLayouts), |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 78 | framework::dataset::make("InterpolationPolicy", { InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })), |
| 79 | datasets::BorderModes()), |
| 80 | framework::dataset::make("SamplingPolicy", { SamplingPolicy::CENTER })), |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 81 | shape, data_type, data_layout, policy, border_mode, sampling_policy) |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 82 | { |
| 83 | std::mt19937 generator(library->seed()); |
| 84 | std::uniform_real_distribution<float> distribution_float(0.25, 2); |
| 85 | const float scale_x = distribution_float(generator); |
| 86 | const float scale_y = distribution_float(generator); |
| 87 | uint8_t constant_border_value = 0; |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 88 | TensorShape src_shape = shape; |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 89 | if(border_mode == BorderMode::CONSTANT) |
| 90 | { |
| 91 | std::uniform_int_distribution<uint8_t> distribution_u8(0, 255); |
| 92 | constant_border_value = distribution_u8(generator); |
| 93 | } |
| 94 | |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 95 | // Get width/height indices depending on layout |
| 96 | const int idx_width = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); |
| 97 | const int idx_height = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); |
| 98 | |
| 99 | // Change shape in case of NHWC. |
| 100 | if(data_layout == DataLayout::NHWC) |
| 101 | { |
| 102 | permute(src_shape, PermutationVector(2U, 0U, 1U)); |
| 103 | } |
| 104 | |
| 105 | // Calculate scaled shape |
| 106 | TensorShape shape_scaled(src_shape); |
| 107 | shape_scaled.set(idx_width, src_shape[idx_width] * scale_x); |
| 108 | shape_scaled.set(idx_height, src_shape[idx_height] * scale_y); |
| 109 | |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 110 | // Create tensors |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 111 | Tensor src = create_tensor<Tensor>(src_shape, data_type, 1, 0, QuantizationInfo(), data_layout); |
| 112 | Tensor dst = create_tensor<Tensor>(shape_scaled, data_type, 1, 0, QuantizationInfo(), data_layout); |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 113 | |
| 114 | ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 115 | ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 116 | |
| 117 | // Create and configure function |
| 118 | NEScale nescale; |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 119 | nescale.configure(&src, &dst, policy, border_mode, constant_border_value, sampling_policy); |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 120 | |
| 121 | // Validate valid region |
Diego Lopez Recas | 0085429 | 2018-02-22 13:08:01 +0000 | [diff] [blame] | 122 | const ValidRegion dst_valid_region = calculate_valid_region_scale(*(src.info()), shape_scaled, policy, sampling_policy, (border_mode == BorderMode::UNDEFINED)); |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 123 | validate(dst.info()->valid_region(), dst_valid_region); |
| 124 | |
| 125 | // Validate padding |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 126 | int num_elements_processed_x = 16; |
| 127 | if(data_layout == DataLayout::NHWC) |
| 128 | { |
| 129 | num_elements_processed_x = (policy == InterpolationPolicy::BILINEAR) ? 1 : 16 / src.info()->element_size(); |
| 130 | } |
| 131 | PaddingCalculator calculator(shape_scaled.x(), num_elements_processed_x); |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 132 | calculator.set_border_mode(border_mode); |
| 133 | |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 134 | PaddingSize read_padding(1); |
| 135 | if(data_layout == DataLayout::NHWC) |
| 136 | { |
| 137 | read_padding = calculator.required_padding(PaddingCalculator::Option::EXCLUDE_BORDER); |
| 138 | if(border_mode == BorderMode::CONSTANT && policy == InterpolationPolicy::BILINEAR) |
| 139 | { |
| 140 | read_padding.top = 1; |
| 141 | } |
| 142 | } |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 143 | const PaddingSize write_padding = calculator.required_padding(PaddingCalculator::Option::EXCLUDE_BORDER); |
| 144 | validate(src.info()->padding(), read_padding); |
| 145 | validate(dst.info()->padding(), write_padding); |
| 146 | } |
| 147 | |
| 148 | template <typename T> |
| 149 | using NEScaleFixture = ScaleValidationFixture<Tensor, Accessor, NEScale, T>; |
| 150 | |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 151 | TEST_SUITE(Float) |
| 152 | TEST_SUITE(FP32) |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 153 | FIXTURE_DATA_TEST_CASE(RunSmall, NEScaleFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 154 | DataType::F32)), |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 155 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 156 | framework::dataset::make("InterpolationPolicy", { InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })), |
| 157 | datasets::BorderModes()), |
| 158 | framework::dataset::make("SamplingPolicy", { SamplingPolicy::CENTER }))) |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 159 | { |
| 160 | //Create valid region |
| 161 | TensorInfo src_info(_shape, 1, _data_type); |
Diego Lopez Recas | 0085429 | 2018-02-22 13:08:01 +0000 | [diff] [blame] | 162 | ValidRegion valid_region = calculate_valid_region_scale(src_info, _reference.shape(), _policy, _sampling_policy, (_border_mode == BorderMode::UNDEFINED)); |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 163 | |
| 164 | // Validate output |
Moritz Pflanzer | ff1c360 | 2017-09-22 12:41:25 +0100 | [diff] [blame] | 165 | validate(Accessor(_target), _reference, valid_region, tolerance_f32, tolerance_num_f32); |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 166 | } |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 167 | FIXTURE_DATA_TEST_CASE(RunLarge, NEScaleFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType", |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 168 | DataType::F32)), |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 169 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 170 | framework::dataset::make("InterpolationPolicy", { InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })), |
| 171 | datasets::BorderModes()), |
| 172 | framework::dataset::make("SamplingPolicy", { SamplingPolicy::CENTER }))) |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 173 | { |
| 174 | //Create valid region |
| 175 | TensorInfo src_info(_shape, 1, _data_type); |
Diego Lopez Recas | 0085429 | 2018-02-22 13:08:01 +0000 | [diff] [blame] | 176 | ValidRegion valid_region = calculate_valid_region_scale(src_info, _reference.shape(), _policy, _sampling_policy, (_border_mode == BorderMode::UNDEFINED)); |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 177 | |
| 178 | // Validate output |
Moritz Pflanzer | ff1c360 | 2017-09-22 12:41:25 +0100 | [diff] [blame] | 179 | validate(Accessor(_target), _reference, valid_region, tolerance_f32, tolerance_num_f32); |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 180 | } |
| 181 | TEST_SUITE_END() |
| 182 | TEST_SUITE_END() |
| 183 | |
| 184 | TEST_SUITE(Integer) |
| 185 | TEST_SUITE(U8) |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 186 | FIXTURE_DATA_TEST_CASE(RunSmall, NEScaleFixture<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 187 | DataType::U8)), |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 188 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 189 | framework::dataset::make("InterpolationPolicy", { InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })), |
| 190 | datasets::BorderModes()), |
| 191 | framework::dataset::make("SamplingPolicy", { SamplingPolicy::CENTER }))) |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 192 | { |
| 193 | //Create valid region |
| 194 | TensorInfo src_info(_shape, 1, _data_type); |
Diego Lopez Recas | 0085429 | 2018-02-22 13:08:01 +0000 | [diff] [blame] | 195 | ValidRegion valid_region = calculate_valid_region_scale(src_info, _reference.shape(), _policy, _sampling_policy, (_border_mode == BorderMode::UNDEFINED)); |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 196 | |
| 197 | // Validate output |
Georgios Pinitas | 99d4f4a | 2017-09-19 16:51:42 +0100 | [diff] [blame] | 198 | validate(Accessor(_target), _reference, valid_region, tolerance_u8); |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 199 | } |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 200 | FIXTURE_DATA_TEST_CASE(RunLarge, NEScaleFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType", |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 201 | DataType::U8)), |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 202 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 203 | framework::dataset::make("InterpolationPolicy", { InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })), |
| 204 | datasets::BorderModes()), |
| 205 | framework::dataset::make("SamplingPolicy", { SamplingPolicy::CENTER }))) |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 206 | { |
| 207 | //Create valid region |
| 208 | TensorInfo src_info(_shape, 1, _data_type); |
Diego Lopez Recas | 0085429 | 2018-02-22 13:08:01 +0000 | [diff] [blame] | 209 | ValidRegion valid_region = calculate_valid_region_scale(src_info, _reference.shape(), _policy, _sampling_policy, (_border_mode == BorderMode::UNDEFINED)); |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 210 | |
| 211 | // Validate output |
Georgios Pinitas | 99d4f4a | 2017-09-19 16:51:42 +0100 | [diff] [blame] | 212 | validate(Accessor(_target), _reference, valid_region, tolerance_u8); |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 213 | } |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 214 | TEST_SUITE_END() |
| 215 | TEST_SUITE(S16) |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 216 | FIXTURE_DATA_TEST_CASE(RunSmall, NEScaleFixture<int16_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 217 | DataType::S16)), |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 218 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 219 | framework::dataset::make("InterpolationPolicy", { InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })), |
| 220 | datasets::BorderModes()), |
| 221 | framework::dataset::make("SamplingPolicy", { SamplingPolicy::CENTER }))) |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 222 | { |
| 223 | //Create valid region |
| 224 | TensorInfo src_info(_shape, 1, _data_type); |
Diego Lopez Recas | 0085429 | 2018-02-22 13:08:01 +0000 | [diff] [blame] | 225 | ValidRegion valid_region = calculate_valid_region_scale(src_info, _reference.shape(), _policy, _sampling_policy, (_border_mode == BorderMode::UNDEFINED)); |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 226 | |
| 227 | // Validate output |
Moritz Pflanzer | ff1c360 | 2017-09-22 12:41:25 +0100 | [diff] [blame] | 228 | validate(Accessor(_target), _reference, valid_region, tolerance_s16, tolerance_num_s16); |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 229 | } |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 230 | FIXTURE_DATA_TEST_CASE(RunLarge, NEScaleFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType", |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 231 | DataType::S16)), |
Georgios Pinitas | 393fa4c | 2018-05-08 15:54:53 +0100 | [diff] [blame^] | 232 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Daniil Efremov | 02bf80d | 2017-11-22 00:26:51 +0700 | [diff] [blame] | 233 | framework::dataset::make("InterpolationPolicy", { InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })), |
| 234 | datasets::BorderModes()), |
| 235 | framework::dataset::make("SamplingPolicy", { SamplingPolicy::CENTER }))) |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 236 | { |
| 237 | //Create valid region |
| 238 | TensorInfo src_info(_shape, 1, _data_type); |
Diego Lopez Recas | 0085429 | 2018-02-22 13:08:01 +0000 | [diff] [blame] | 239 | ValidRegion valid_region = calculate_valid_region_scale(src_info, _reference.shape(), _policy, _sampling_policy, (_border_mode == BorderMode::UNDEFINED)); |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 240 | |
| 241 | // Validate output |
Moritz Pflanzer | ff1c360 | 2017-09-22 12:41:25 +0100 | [diff] [blame] | 242 | validate(Accessor(_target), _reference, valid_region, tolerance_s16, tolerance_num_s16); |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 243 | } |
| 244 | TEST_SUITE_END() |
| 245 | TEST_SUITE_END() |
Isabella Gottardi | 1fab09f | 2017-07-13 15:55:57 +0100 | [diff] [blame] | 246 | |
| 247 | TEST_SUITE_END() |
| 248 | TEST_SUITE_END() |
| 249 | } // namespace validation |
| 250 | } // namespace test |
| 251 | } // namespace arm_compute |