30 #include "tests/datasets/DirectConvolutionLayerDataset.h" 31 #include "tests/datasets/ShapeDatasets.h" 36 #include "tests/validation/fixtures/DirectConvolutionLayerFixture.h" 46 RelativeTolerance<half> tolerance_fp16(
half(0.2));
48 constexpr
float tolerance_num = 0.07f;
49 constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1);
60 const auto data_all_kernels =
concat(
concat(data_ksize_one, data_ksize_three), data_ksize_five);
62 const auto data =
combine(datasets::SmallDirectConvolutionShapes(),
combine(data_strides, data_all_kernels));
63 const auto data9x9 =
combine(datasets::SmallDirectConvolutionShapes(),
combine(data_strides, data_ksize_nine));
64 const auto data_small =
combine(datasets::SmallDirectConvolutionShapes(),
combine(data_strides_small, data_ksize_one_small));
65 const auto data_small9x9 =
combine(datasets::SmallDirectConvolutionShapes(),
combine(data_strides_small, data_ksize_nine_small));
157 framework::dataset::make(
"Expected", {
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
true })),
160 bool is_valid = bool(
CLDirectConvolutionLayer::validate(&
input_info.clone()->set_is_resizable(
false), &weights_info.clone()->set_is_resizable(
false), &biases_info.clone()->set_is_resizable(
false), &output_info.clone()->set_is_resizable(
false),
conv_info, act_info));
164 template <
typename T>
166 template <
typename T>
168 template <
typename T>
170 template <
typename T>
338 ActivationFunctionsDataset),
345 ActivationFunctionsDataset),
356 ActivationFunctionsDataset),
362 ActivationFunctionsDataset),
372 ActivationFunctionsDataset))
391 framework::dataset::
make("
QuantizationInfo", { QuantizationInfo(2.f / 255, 10), QuantizationInfo(1.1f, 10) })),
433 framework::dataset::
make("
DataType", DataType::QASYMM8)),
434 framework::dataset::
make("
QuantizationInfo", { QuantizationInfo(2.f / 255, 127), QuantizationInfo(1.1f, 10) })),
446 DataType::QASYMM8_SIGNED)),
447 framework::dataset::
make("
QuantizationInfo", { QuantizationInfo(2.f / 255, 10), QuantizationInfo(1.1f, -10) })),
half_float::half half
16-bit floating point type
1 channel, 1 F32 per channel
ARM_COMPUTE_EXPECT(has_error==expected, framework::LogLevel::ERRORS)
static Status validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of CLDirectConvolutionLayer...
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
RelativeTolerance< float > tolerance_fp32(0.001f)
Activation Layer Information class.
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
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)
DirectConvolutionValidationWithTensorShapesQuantizedFixture< CLTensor, CLAccessor, CLDirectConvolutionLayer, T > CLDirectConvolutionValidationWithTensorShapesQuantizedFixture
DatasetMode
Possible dataset modes.
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
[CLActivationLayer Test snippet]
quantized, asymmetric fixed-point 8-bit number unsigned
Accessor implementation for CLTensor objects.
const auto QuantizedActivationFunctionsDataset
Input data sets.
TEST_SUITE(U8_to_S8) FIXTURE_DATA_TEST_CASE(RunSmall
Padding and stride information class.
validate(CLAccessor(output_state), expected_output)
Num samples, channels, height, width.
Lower and Upper Bounded Rectifier ( )
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsLayerFixture< half >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
Num samples, height, width, channels.
DirectConvolutionValidationWithTensorShapesFixture< CLTensor, CLAccessor, CLDirectConvolutionLayer, T > CLDirectConvolutionValidationWithTensorShapesFixture
Store the tensor's metadata.
JoinDataset< T, U > concat(T &&dataset1, U &&dataset2)
Helper function to create a JoinDataset.
quantized, asymmetric fixed-point 8-bit number signed
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}))
DataType
Available data types.
DirectConvolutionValidationQuantizedFixture< CLTensor, CLAccessor, CLDirectConvolutionLayer, T > CLDirectConvolutionLayerQuantizedFixture
DataLayout
[DataLayout enum definition]
combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
DirectConvolutionValidationFixture< CLTensor, CLAccessor, CLDirectConvolutionLayer, T > CLDirectConvolutionLayerFixture