31 #include "tests/datasets/BorderModeDataset.h" 32 #include "tests/datasets/SamplingPolicyDataset.h" 33 #include "tests/datasets/ShapeDatasets.h" 39 #include "tests/validation/fixtures/ScaleFixture.h" 59 constexpr AbsoluteTolerance<uint8_t> tolerance_u8(1);
60 constexpr AbsoluteTolerance<int16_t> tolerance_s16(1);
61 constexpr
float tolerance_f32_absolute(0.001f);
63 RelativeTolerance<float> tolerance_f32(0.05);
64 RelativeTolerance<half> tolerance_f16(
half(0.1));
66 constexpr
float tolerance_num_f32(0.01f);
74 datasets::BorderModes()),
75 datasets::SamplingPolicies()),
78 std::mt19937 generator(
library->seed());
79 std::uniform_real_distribution<float> distribution_float(0.25, 2);
80 const float scale_x = distribution_float(generator);
81 const float scale_y = distribution_float(generator);
82 std::uniform_int_distribution<uint8_t> distribution_u8(0, 255);
83 uint8_t constant_border_value = distribution_u8(generator);
88 shape_scaled.set(0, shape[0] * scale_x);
89 shape_scaled.set(1, shape[1] * scale_y);
116 template <
typename T>
125 datasets::BorderModes()),
126 datasets::SamplingPolicies()))
133 validate(
CLAccessor(_target), _reference, valid_region, tolerance_f32, tolerance_num_f32, tolerance_f32_absolute);
139 datasets::BorderModes()),
140 datasets::SamplingPolicies()))
147 validate(
CLAccessor(_target), _reference, valid_region, tolerance_f32, tolerance_num_f32, tolerance_f32_absolute);
155 datasets::BorderModes()),
156 datasets::SamplingPolicies()))
169 datasets::BorderModes()),
170 datasets::SamplingPolicies()))
188 datasets::BorderModes()),
189 datasets::SamplingPolicies()))
202 datasets::BorderModes()),
203 datasets::SamplingPolicies()))
218 datasets::BorderModes()),
219 datasets::SamplingPolicies()))
232 datasets::BorderModes()),
233 datasets::SamplingPolicies()))
InterpolationPolicy
Interpolation method.
bool is_resizable() const override
Flag indicating whether the size of the tensor can be changed.
Container for 2D border size.
ValidRegion valid_region() const override
Valid region of the tensor.
1 channel, 1 U8 per channel
half_float::half half
16-bit floating point type
1 channel, 1 F32 per channel
Output values are defined by bilinear interpolation between the pixels.
PaddingCalculator calculator(shape.x(), 8)
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
PaddingSize padding() const override
Padding of tensor.
PaddingSize required_padding() const
Compute the required padding.
TensorInfo * info() const override
Interface to be implemented by the child class to return the tensor's metadata.
ScaleValidationFixture< CLTensor, CLAccessor, CLScale, T > CLScaleFixture
Output values are defined to match the source pixel whose center is nearest to the sample position...
Basic function to run CLScaleKernel.
This file contains all available output stages for GEMMLowp on OpenCL.
1 channel, 1 F16 per channel
#define TEST_SUITE(SUITE_NAME)
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsoluteDifferenceFixture< uint8_t >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), AbsoluteDifferenceU8Dataset))
validate(dst.info() ->valid_region(), dst_valid_region)
DatasetMode
Possible dataset modes.
void configure(ICLTensor *input, ICLTensor *output, InterpolationPolicy policy, BorderMode border_mode, PixelValue constant_border_value=PixelValue(), SamplingPolicy sampling_policy=SamplingPolicy::CENTER)
Initialize the function's source, destination, interpolation type and border_mode.
std::unique_ptr< AssetsLibrary > library
Accessor implementation for CLTensor objects.
1 channel, 1 S16 per channel
Num samples, channels, height, width.
DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), AbsoluteDifferenceU8Dataset), shape, data_type0, data_type1, output_data_type)
TEST_SUITE_END() DATA_TEST_CASE(Configuration
const ValidRegion dst_valid_region
ARM_COMPUTE_EXPECT(src.info() ->is_resizable(), framework::LogLevel::ERRORS)
Borders are left undefined.
ValidRegion calculate_valid_region_scale(const ITensorInfo &src_info, const TensorShape &dst_shape, InterpolationPolicy interpolate_policy, SamplingPolicy sampling_policy, bool border_undefined)
Helper function to calculate the Valid Region for Scale.
combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType",{DataType::U8, DataType::S16})), datasets::BorderModes()), framework::dataset::make("filter_size",{5}))
Store the tensor's metadata.
JoinDataset< T, U > concat(T &&dataset1, U &&dataset2)
Helper function to create a JoinDataset.
Container for valid region of a window.
DataType
Available data types.
DataLayout
Supported tensor data layouts.
convolution configure & src
Calculate required padding.
void set_border_mode(BorderMode mode)
Set border mode.
Basic implementation of the OpenCL tensor interface.