31 #include "tests/datasets/DilatedConvolutionLayerDataset.h" 36 #include "tests/validation/fixtures/ConvolutionLayerFixture.h" 46 const AbsoluteTolerance<float> tolerance_f32(0.001f);
47 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 48 const AbsoluteTolerance<float> tolerance_f16(0.01f);
50 const AbsoluteTolerance<float> tolerance_q(1.0f);
51 constexpr AbsoluteTolerance<float> tolerance_qasymm8(0.0);
56 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 99 &weights_info.clone()->set_is_resizable(
false),
100 &output_info.clone()->set_is_resizable(
false),
120 Tensor bias = create_tensor<Tensor>(bias_shape, bias_data_type, 1, fixed_point_position,
QuantizationInfo(2.f / 255.f, 127));
129 const QuantizationInfo weights_quantization_info = weights.info()->quantization_info();
142 validate(weights.info()->valid_region(), weights_valid_region);
143 validate(bias.info()->valid_region(), bias_valid_region);
151 template <
typename T>
155 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 158 framework::dataset::
make("ReshapeWeights", {
true })),
180 framework::dataset::
make("ReshapeWeights", {
true })),
200 template <
typename T>
208 framework::dataset::
make("ReshapeWeights", {
true })),
232 framework::dataset::
make("ReshapeWeights", {
true })),
253 template <
typename T>
260 framework::dataset::
make("ReshapeWeights", {
true })),
quantized, symmetric fixed-point 16-bit number
quantized, symmetric fixed-point 8-bit number
static ConvolutionMethod get_convolution_method(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *output, const PadStrideInfo &conv_info, const WeightsInfo &weights_info=WeightsInfo(), const Size2D &dilation=Size2D(1U, 1U), const ActivationLayerInfo &act_info=ActivationLayerInfo(), bool enable_fast_math=false)
Static function to check if given info will return the convolution called by NEConvolutionLayer.
half_float::half half
16-bit floating point type
1 channel, 1 F32 per channel
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
ConvolutionMethod
Available ConvolutionMethod.
Activation Layer Information class.
Basic function to simulate a convolution layer.
src info() -> set_format(Format::S16)
This file contains all available output stages for GEMMLowp on OpenCL.
ConvolutionValidationFixture< Tensor, Accessor, NEConvolutionLayer, T > NEGEMMDilatedConvolutionLayerFixture
1 channel, 1 F16 per channel
virtual ValidRegion valid_region() const =0
Valid region of the tensor.
#define TEST_SUITE(SUITE_NAME)
Convolution Layer Weights Information class.
1 channel, 1 S32 per channel
virtual bool is_resizable() const =0
Flag indicating whether the size of the tensor can be changed.
void configure(const ITensor *input, const ITensor *weights, const ITensor *biases, ITensor *output, const PadStrideInfo &conv_info, const WeightsInfo &weights_info=WeightsInfo(), const Size2D &dilation=Size2D(1U, 1U), const ActivationLayerInfo &act_info=ActivationLayerInfo())
Set the input and output tensors.
ConvolutionValidationQuantizedFixture< Tensor, Accessor, NEGEMMConvolutionLayer, T > NEGEMMDilatedConvolutionLayerQuantizedFixture
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsoluteDifferenceFixture< uint8_t >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), AbsoluteDifferenceU8Dataset))
validate(dst.info() ->valid_region(), dst_valid_region)
Accessor implementation for Tensor objects.
DatasetMode
Possible dataset modes.
ConvolutionValidationFixedPointFixture< Tensor, Accessor, NEGEMMConvolutionLayer, T > NEGEMMDilatedConvolutionLayerFixedPointFixture
quantized, asymmetric fixed-point 8-bit number
bool is_data_type_fixed_point(DataType dt)
Check if a given data type is of fixed point type.
Basic implementation of the tensor interface.
Padding and stride information class.
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
Num samples, channels, height, width.
bool is_data_type_quantized_asymmetric(DataType dt)
Check if a given data type is of asymmetric quantized type.
DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), AbsoluteDifferenceU8Dataset), shape, data_type0, data_type1, output_data_type)
TEST_SUITE_END() DATA_TEST_CASE(Configuration
const ValidRegion dst_valid_region
ARM_COMPUTE_EXPECT(src.info() ->is_resizable(), framework::LogLevel::ERRORS)
Class for specifying the size of an image or rectangle.
Num samples, height, width, channels.
combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), framework::dataset::make("DataType",{DataType::U8, DataType::S16})), datasets::BorderModes()), framework::dataset::make("filter_size",{5}))
Store the tensor's metadata.
JoinDataset< T, U > concat(T &&dataset1, U &&dataset2)
Helper function to create a JoinDataset.
Quantization settings (used for QASYMM8 data type)
Container for valid region of a window.
zip(zip(zip(framework::dataset::make("InputInfo",{TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::F16), TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::QASYMM8), TensorInfo(TensorShape(5U, 5U, 5U, 3U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 37U, 2U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 37U, 22U), 1, DataType::F32)}), framework::dataset::make("OutputInfo",{TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F16), TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::QASYMM8), TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F32), TensorInfo(TensorShape(1U, 1U, 16U), 1, DataType::F32), TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F32), TensorInfo(TensorShape(2U, 37U, 16U), 1, DataType::F32), TensorInfo(TensorShape(22U, 37U, 36U), 1, DataType::F32)})), framework::dataset::make("WinogradInfo",{WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(3U, 3U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW), WinogradInfo(Size2D(4U, 4U), Size2D(3U, 3U), Size2D(), PadStrideInfo(), DataLayout::NCHW)})), framework::dataset::make("Expected",{false, false, false, false, true, true, true}))
convolution configure & src
ValidRegion shape_to_valid_region(const TensorShape &a_shape, bool border_undefined=false, BorderSize border_size=BorderSize(0))
Create a valid region based on tensor shape, border mode and border size.
ITensorInfo * info() const override
Interface to be implemented by the child class to return the tensor's metadata.