30 #include "tests/datasets/ConvertPolicyDataset.h" 31 #include "tests/datasets/ShapeDatasets.h" 36 #include "tests/validation/fixtures/DepthConvertLayerFixture.h" 79 constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1);
80 constexpr AbsoluteTolerance<int32_t> tolerance_one_int32(1);
81 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 82 constexpr AbsoluteTolerance<uint8_t> tolerance_one_uint8(1);
121 template <
typename T>
123 template <
typename T>
125 template <
typename T>
127 template <
typename T>
129 template <
typename T>
131 template <
typename T>
133 template <
typename T>
135 template <
typename T>
137 template <
typename T>
139 template <
typename T>
141 template <
typename T>
143 template <
typename T>
148 DepthConvertLayerQASYMM8toF32Dataset),
150 DepthConvertLayerZeroShiftDataset),
157 DepthConvertLayerQASYMM8toF32Dataset),
159 DepthConvertLayerZeroShiftDataset),
169 DepthConvertLayerQASYMM8toS32Dataset),
171 DepthConvertLayerZeroShiftDataset),
178 DepthConvertLayerQASYMM8toS32Dataset),
180 DepthConvertLayerZeroShiftDataset),
191 DepthConvertLayerShiftDatasetPrecommit))
199 DepthConvertLayerShiftDatasetNightly))
209 DepthConvertLayerShiftDatasetPrecommit))
217 DepthConvertLayerShiftDatasetNightly))
226 DepthConvertLayerShiftDatasetPrecommit))
234 DepthConvertLayerShiftDatasetNightly))
244 DepthConvertLayerShiftDatasetPrecommit))
252 DepthConvertLayerShiftDatasetNightly))
259 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 263 DepthConvertLayerShiftDatasetPrecommit))
271 DepthConvertLayerShiftDatasetNightly))
277 #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 282 DepthConvertLayerShiftDatasetPrecommit))
289 DepthConvertLayerShiftDatasetNightly))
299 DepthConvertLayerShiftDatasetPrecommit))
306 DepthConvertLayerShiftDatasetNightly))
316 DepthConvertLayerShiftDatasetPrecommit))
323 DepthConvertLayerShiftDatasetNightly))
333 DepthConvertLayerShiftDatasetPrecommit))
340 DepthConvertLayerShiftDatasetNightly))
347 #if defined(__ARM_FEATURE_BF16_VECTOR_ARITHMETIC) || defined(ARM_COMPUTE_FORCE_BF16) 351 DepthConvertLayerZeroShiftDataset))
361 DepthConvertLayerZeroShiftDataset))
369 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 372 DepthConvertLayerF16toQASYMM8Dataset),
374 DepthConvertLayerZeroShiftDataset),
381 DepthConvertLayerF16toQASYMM8Dataset),
383 DepthConvertLayerZeroShiftDataset),
394 DepthConvertLayerZeroShiftDataset))
401 DepthConvertLayerZeroShiftDataset))
411 DepthConvertLayerZeroShiftDataset))
418 DepthConvertLayerZeroShiftDataset))
428 DepthConvertLayerZeroShiftDataset))
435 DepthConvertLayerZeroShiftDataset))
445 DepthConvertLayerQASYMM8toF16Dataset),
447 DepthConvertLayerZeroShiftDataset),
454 DepthConvertLayerQASYMM8toF16Dataset),
456 DepthConvertLayerZeroShiftDataset),
467 DepthConvertLayerZeroShiftDataset))
474 DepthConvertLayerZeroShiftDataset))
484 DepthConvertLayerZeroShiftDataset))
491 DepthConvertLayerZeroShiftDataset))
503 DepthConvertLayerZeroShiftDataset))
510 DepthConvertLayerZeroShiftDataset))
520 DepthConvertLayerZeroShiftDataset))
527 DepthConvertLayerZeroShiftDataset))
536 DepthConvertLayerF32toQASYMM8Dataset),
538 DepthConvertLayerZeroShiftDataset),
545 DepthConvertLayerF32toQASYMM8Dataset),
547 DepthConvertLayerZeroShiftDataset),
558 DepthConvertLayerZeroShiftDataset))
565 DepthConvertLayerZeroShiftDataset))
574 DepthConvertLayerS32toQASYMM8Dataset),
576 DepthConvertLayerZeroShiftDataset),
583 DepthConvertLayerS32toQASYMM8Dataset),
585 DepthConvertLayerZeroShiftDataset),
596 DepthConvertLayerZeroShiftDataset))
603 DepthConvertLayerZeroShiftDataset))
DepthConvertLayerValidationFixture< Tensor, Accessor, NEDepthConvertLayer, T, uint32_t > NEDepthConvertLayerToU32Fixture
1 channel, 1 U8 per channel
1 channel, 1 F32 per channel
ARM_COMPUTE_EXPECT(has_error==expected, framework::LogLevel::ERRORS)
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.
DepthConvertLayerValidationQuantizedFixture< Tensor, Accessor, NEDepthConvertLayer, T, float > NEDepthConvertLayerQuantizedToF32Fixture
DepthConvertLayerValidationFixture< Tensor, Accessor, NEDepthConvertLayer, T, int32_t > NEDepthConvertLayerToS32Fixture
DepthConvertLayerValidationQuantizedFixture< Tensor, Accessor, NEDepthConvertLayer, T, uint8_t > NEDepthConvertLayerToQASYMM8Fixture
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
static Status validate(const ITensorInfo *input, const ITensorInfo *output, ConvertPolicy policy, uint32_t shift=0)
Static function to check if given info will lead to a valid configuration of NEDepthConvertLayer.
1 channel, 1 S32 per channel
16-bit brain floating-point number
DepthConvertLayerValidationQuantizedFixture< Tensor, Accessor, NEDepthConvertLayer, T, half > NEDepthConvertLayerQuantizedToF16Fixture
DepthConvertLayerValidationQuantizedFixture< Tensor, Accessor, NEDepthConvertLayer, T, int32_t > NEDepthConvertLayerQuantizedToS32Fixture
Quantization information.
DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), }), framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(30U, 11U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), })), framework::dataset::make("ActivationInfo", { ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SQRT), })), framework::dataset::make("Expected", { false, true, true, true, false, false, true, true, false })), input_info, output_info, act_info, expected)
Accessor implementation for Tensor objects.
DatasetMode
Possible dataset modes.
DepthConvertLayerValidationFixture< Tensor, Accessor, NEDepthConvertLayer, T, half > NEDepthConvertLayerToF16Fixture
1 channel, 1 U32 per channel
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
[CLActivationLayer Test snippet]
quantized, asymmetric fixed-point 8-bit number unsigned
DepthConvertLayerValidationFixture< Tensor, Accessor, NEDepthConvertLayer, T, bfloat16 > NEDepthConvertLayerToBF16Fixture
TEST_SUITE(U8_to_S8) FIXTURE_DATA_TEST_CASE(RunSmall
validate(CLAccessor(output_state), expected_output)
DepthConvertLayerValidationFixture< Tensor, Accessor, NEDepthConvertLayer, T, int16_t > NEDepthConvertLayerToS16Fixture
1 channel, 1 S16 per channel
DepthConvertLayerValidationFixture< Tensor, Accessor, NEDepthConvertLayer, T, uint16_t > NEDepthConvertLayerToU16Fixture
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsLayerFixture< half >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
DepthConvertLayerValidationFixture< Tensor, Accessor, NEDepthConvertLayer, T, uint8_t > NEDepthConvertLayerToU8Fixture
Store the tensor's metadata.
zip(zip(framework::dataset::make("Weights", { TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U, 1U), 1, DataType::F32), }), framework::dataset::make("MVBGInfo",{ TensorInfo(TensorShape(2U), 1, DataType::F32), TensorInfo(TensorShape(2U), 1, DataType::F16), TensorInfo(TensorShape(5U), 1, DataType::F32), })), framework::dataset::make("Expected", { true, false, false}))
DepthConvertLayerValidationFixture< Tensor, Accessor, NEDepthConvertLayer, T, float > NEDepthConvertLayerToF32Fixture
combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
ConvertPolicy
Policy to handle overflow.