27 #include "tests/datasets/ScaleValidationDataset.h"
30 #include "tests/validation/fixtures/ScaleFixture.h"
40 using datasets::ScaleShapesBaseDataSet;
41 using datasets::ScaleInterpolationPolicySet;
42 using datasets::ScaleDataLayouts;
43 using datasets::ScaleSamplingPolicySet;
44 using datasets::ScaleAlignCornersSamplingPolicySet;
51 constexpr uint32_t vector_byte = 64;
54 constexpr uint32_t num_elements_per_vector()
56 return vector_byte /
sizeof(T);
62 QuantizationInfo(0.5f, -10),
68 QuantizationInfo(0.5f, -10),
74 QuantizationInfo(0.2f, 20),
78 constexpr AbsoluteTolerance<uint8_t> tolerance_u8(1);
79 constexpr AbsoluteTolerance<int8_t> tolerance_s8(1);
80 constexpr AbsoluteTolerance<int16_t> tolerance_s16(1);
82 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
83 constexpr
float abs_tolerance_f16(0.01f);
87 constexpr
float tolerance_num_s16 = 0.01f;
88 constexpr
float tolerance_num_f32 = 0.01f;
113 const auto input_shape = TensorShape{ 2, 3, 3, 2 };
139 const std::map<DataType, bool> supported_data_types =
156 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
158 #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
164 for(
auto &kv : supported_data_types)
194 constexpr
bool use_padding =
true;
233 constexpr
bool align_corners =
true;
314 template <
typename T>
316 template <
typename T>
318 template <
typename T>
320 template <
typename T>
322 template <
typename T>
359 TensorInfo
src_info(_shape, 1, _data_type);
368 TensorInfo
src_info(_shape, 1, _data_type);
377 TensorInfo
src_info(_shape, 1, _data_type);
384 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
391 TensorInfo
src_info(_shape, 1, _data_type);
400 TensorInfo
src_info(_shape, 1, _data_type);
409 TensorInfo
src_info(_shape, 1, _data_type);
418 TensorInfo
src_info(_shape, 1, _data_type);
427 TensorInfo
src_info(_shape, 1, _data_type);
439 const auto u8_shape =
combine((SCALE_SHAPE_DATASET(num_elements_per_vector<uint8_t>())), framework::dataset::
make("
DataType",
DataType::U8));
443 TensorInfo
src_info(_shape, 1, _data_type);
452 TensorInfo
src_info(_shape, 1, _data_type);
460 const auto s8_shape =
combine((SCALE_SHAPE_DATASET(num_elements_per_vector<int8_t>())), framework::dataset::
make("
DataType",
DataType::S8));
464 TensorInfo
src_info(_shape, 1, _data_type);
473 TensorInfo
src_info(_shape, 1, _data_type);
481 const auto s16_shape =
combine((SCALE_SHAPE_DATASET(num_elements_per_vector<int16_t>())), framework::dataset::
make("
DataType",
DataType::S16));
485 TensorInfo
src_info(_shape, 1, _data_type);
494 TensorInfo
src_info(_shape, 1, _data_type);
509 TensorInfo
src_info(_shape, 1, _data_type);
516 ASSEMBLE_DIFFERENTLY_QUANTIZED_DATASET(
qasymm8_shape, ScaleSamplingPolicySet, InputQuantizationInfoSet, OutputQuantizationInfoSet))
526 QuantizationInfoSet))
536 QuantizationInfoSet))
547 const auto qasymm8_signed_shape =
combine((SCALE_SHAPE_DATASET(num_elements_per_vector<int8_t>())), framework::dataset::
make("
DataType",
DataType::QASYMM8_SIGNED));
559 ASSEMBLE_DIFFERENTLY_QUANTIZED_DATASET(qasymm8_signed_shape, ScaleSamplingPolicySet, InputQuantizationInfoSet, OutputQuantizationInfoSet))
569 QuantizationInfoSet))