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);
85 constexpr
float abs_tolerance_f16(0.1f);
88 constexpr
float tolerance_num_f32(0.01f);
121 const std::map<DataType, bool> supported_data_types =
144 for(
auto &kv : supported_data_types)
179 constexpr
bool align_corners =
true;
202 template <typename T>
204 template <typename T>
271 TensorInfo
src_info(_shape, 1, _data_type);
301 const auto u8_shape =
combine((SCALE_PRECOMMIT_SHAPE_DATASET(num_elements_per_vector<uint8_t>())), framework::dataset::
make("
DataType",
DataType::U8));
314 TensorInfo
src_info(_shape, 1, _data_type);
341 const auto s16_shape =
combine((SCALE_PRECOMMIT_SHAPE_DATASET(num_elements_per_vector<int16_t>())), framework::dataset::
make("
DataType",
DataType::S16));
354 TensorInfo
src_info(_shape, 1, _data_type);
382 template <typename T>
383 using CLScaleQuantizedFixture = ScaleValidationQuantizedFixture<
CLTensor, CLAccessor,
CLScale, T>;
397 QuantizationInfoSet))
417 QuantizationInfoSet))
428 const auto qasymm8_signed_shape =
combine((SCALE_PRECOMMIT_SHAPE_DATASET(num_elements_per_vector<int8_t>())), framework::dataset::
make("
DataType",
DataType::QASYMM8_SIGNED));
429 FIXTURE_DATA_TEST_CASE(Run, CLScaleQuantizedFixture<int8_t>, framework::
DatasetMode::ALL, ASSEMBLE_QUANTIZED_DATASET(qasymm8_signed_shape, ScaleSamplingPolicySet, QuantizationInfoSet))
439 QuantizationInfoSet))
450 QuantizationInfoSet))
460 ScaleAlignCornersSamplingPolicySet,
461 QuantizationInfoSet))