31 #include "tests/datasets/ScaleValidationDataset.h" 36 #include "tests/validation/fixtures/ScaleFixture.h" 46 using datasets::ScaleShapesBaseDataSet;
47 using datasets::ScaleInterpolationPolicySet;
48 using datasets::ScaleDataLayouts;
49 using datasets::ScaleSamplingPolicySet;
50 using datasets::ScaleAlignCornersSamplingPolicySet;
55 constexpr uint32_t vector_byte = 16;
58 constexpr uint32_t num_elements_per_vector()
60 return vector_byte /
sizeof(T);
75 QuantizationInfo(0.5f, -1),
79 constexpr AbsoluteTolerance<uint8_t> tolerance_q8(1);
80 constexpr AbsoluteTolerance<int8_t> tolerance_qs8(1);
81 constexpr AbsoluteTolerance<int16_t> tolerance_s16(1);
82 constexpr
float tolerance_f32_absolute(0.001f);
87 constexpr
float tolerance_num_f32(0.01f);
120 const std::map<DataType, bool> supported_data_types =
143 for(
auto &kv : supported_data_types)
178 constexpr
bool align_corners =
true;
211 template <
typename T>
212 using CLScaleFixture = ScaleValidationFixture<CLTensor, CLAccessor, CLScale, T>;
213 template <
typename T>
218 const auto
f32_shape =
combine((SCALE_PRECOMMIT_SHAPE_DATASET(num_elements_per_vector<
float>())), framework::dataset::
make("
DataType", DataType::F32));
267 const auto f16_shape =
combine((SCALE_PRECOMMIT_SHAPE_DATASET(num_elements_per_vector<
half>())), framework::dataset::
make("DataType", DataType::F16));
310 const auto u8_shape =
combine((SCALE_PRECOMMIT_SHAPE_DATASET(num_elements_per_vector<uint8_t>())), framework::dataset::
make("DataType", DataType::U8));
350 const auto s16_shape =
combine((SCALE_PRECOMMIT_SHAPE_DATASET(num_elements_per_vector<int16_t>())), framework::dataset::
make("DataType", DataType::S16));
391 template <typename T>
395 const auto
qasymm8_shape =
combine((SCALE_PRECOMMIT_SHAPE_DATASET(num_elements_per_vector<uint8_t>())), framework::dataset::
make("DataType", DataType::QASYMM8));
403 validate(CLAccessor(_target), _reference, valid_region, tolerance_q8);
406 QuantizationInfoSet))
426 QuantizationInfoSet))
448 QuantizationInfoSet))
459 QuantizationInfoSet))
469 ScaleAlignCornersSamplingPolicySet,
470 QuantizationInfoSet))
Class describing the value of a pixel for any image format.
const auto default_input_shape
RelativeTolerance< float > tolerance_f32(0.001f)
F32 Tolerance value for comparing reference's output against implementation's output for floating poi...
quantized, symmetric fixed-point 16-bit number
constexpr auto default_data_type
1 channel, 1 U8 per channel
half_float::half half
16-bit floating point type
1 channel, 1 F32 per channel
ARM_COMPUTE_EXPECT(has_error==expected, framework::LogLevel::ERRORS)
Output values are defined by bilinear interpolation between the pixels.
quantized, asymmetric fixed-point 16-bit number
1 channel, 1 U16 per channel
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
Output values are defined to match the source pixel whose center is nearest to the sample position...
const ValidRegion valid_region
ScaleFixture< CLTensor, CLScale, CLAccessor > CLScaleFixture
Basic function to run opencl::ClScale.
Copyright (c) 2017-2021 Arm Limited.
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ScaleKernelInfo &info)
Static function to check if given info will lead to a valid configuration of CLScale.
1 channel, 1 F16 per channel
constexpr bool default_use_padding
Samples are taken at pixel center.
1 channel, 1 S32 per channel
const auto f16_nightly_shape
16-bit brain floating-point number
DatasetMode
Possible dataset modes.
const auto qasymm8_signed_nightly_shape
1 channel, 1 U32 per channel
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
[CLActivationLayer Test snippet]
const auto s16_nightly_shape
quantized, asymmetric fixed-point 8-bit number unsigned
Accessor implementation for CLTensor objects.
const auto u8_nightly_shape
TEST_SUITE(U8_to_S8) FIXTURE_DATA_TEST_CASE(RunSmall
const auto qasymm8_nightly_shape
validate(CLAccessor(output_state), expected_output)
constexpr auto default_border_mode
constexpr auto default_data_layout
1 channel, 1 S16 per channel
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
quantized, symmetric fixed-point 8-bit number
TensorInfo src_info(src_shape, 1, data_type)
quantized, symmetric per channel fixed-point 8-bit number
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.
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsLayerFixture< half >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
const auto f32_nightly_shape
Borders are left undefined.
ScaleValidationFixture< CLTensor, CLAccessor, CLScale, T, true > CLScaleMixedDataLayoutFixture
Num samples, height, width, channels.
constexpr auto default_interpolation_policy
Store the tensor's metadata.
TEST_CASE(FusedActivation, framework::DatasetMode::ALL)
Validate fused activation expecting the following behaviours:
quantized, asymmetric fixed-point 8-bit number signed
const auto default_output_shape
64-bit floating-point number
RelativeTolerance< half_float::half > tolerance_f16(half(0.2))
F16 Tolerance value for comparing reference's output against implementation's output for floating poi...
Container for valid region of a window.
DataType
Available data types.
combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
Basic implementation of the OpenCL tensor interface.