31 #include "tests/datasets/DepthwiseConvolutionLayerDataset.h" 36 #include "tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h" 48 constexpr RelativeTolerance<float> tolerance_f32(0.01f);
49 constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1);
58 datasets::LargeDepthwiseConvolutionLayerDataset3x3()),
64 TensorShape weights_shape(kernel_size.width, kernel_size.height);
66 const TensorInfo in_info(input_shape, 1, data_type);
67 const TensorInfo we_info(weights_shape, 1, data_type);
70 weights_shape.
set(2, output_shape.
z());
86 depthwise_layer.
configure(&src, &weights, &bias, &dst, info, depth_multiplier);
95 validate(dst.info()->valid_region(), output_valid_region);
96 validate(weights.info()->valid_region(), weights_valid_region);
101 const int step_non_opt_dwc = 16 >> info.stride().first;
103 const int step = is_optimized_run ? step_bias_add :
std::max(step_non_opt_dwc, step_bias_add);
105 validate(dst.info()->padding(), padding);
111 template <
typename T>
132 template <
typename T>
163 template <
typename T>
165 template <
typename T>
174 framework::dataset::
make("
DataType", DataType::QASYMM8)),
184 framework::dataset::
make("
DataType", DataType::QASYMM8)),
T z() const
Alias to access the size of the third dimension.
void configure(ITensor *input, const ITensor *weights, const ITensor *biases, ITensor *output, const PadStrideInfo &conv_info, unsigned int depth_multiplier=1)
Initialize the function's source, destination, kernels and border_size.
Container for 2D border size.
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.
src info() -> set_format(Format::S16)
This file contains all available output stages for GEMMLowp on OpenCL.
virtual ValidRegion valid_region() const =0
Valid region of the tensor.
#define TEST_SUITE(SUITE_NAME)
Basic function to execute a depthwise convolution for kernel size 3x3xC.
virtual bool is_resizable() const =0
Flag indicating whether the size of the tensor can be changed.
DepthwiseConvolutionLayerValidationQuantizedFixture< Tensor, Accessor, NEDepthwiseConvolutionLayer, T > NEDepthwiseConvolutionLayerQuantizedFixture
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.
DepthwiseConvolutionLayerValidationFixture< Tensor, Accessor, NEDepthwiseConvolutionLayer, T > NEDepthwiseConvolutionLayerFixture
TensorShape compute_depthwise_convolution_shape(const ITensorInfo &input, const ITensorInfo &weights, PadStrideInfo conv_info, unsigned int depth_multiplier)
quantized, asymmetric fixed-point 8-bit number
Basic implementation of the tensor interface.
virtual size_t element_size() const =0
Element size in bytes calculated as data_size() * num_channels()
Num samples, channels, height, width.
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
ARM_COMPUTE_EXPECT(src.info() ->is_resizable(), framework::LogLevel::ERRORS)
Num samples, height, width, channels.
TensorShape & set(size_t dimension, size_t value, bool apply_dim_correction=true)
Accessor to set the value of one of the dimensions.
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.
fixed_point< T > max(fixed_point< T > x, fixed_point< T > y)
JoinDataset< T, U > concat(T &&dataset1, U &&dataset2)
Helper function to create a JoinDataset.
Quantization settings (used for QASYMM8 data type)
static bool is_optimized_execution_possible(TensorShape input_shape, PadStrideInfo conv_info, DataType dt, unsigned int depth_multiplier=1, DataLayout data_layout=DataLayout::NCHW)
Static method that checks if optimized execution is supported for the given parameters.
Container for valid region of a window.
DataType
Available data types.
DepthwiseConvolutionLayerValidationFixture< Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T > NEDepthwiseConvolutionLayerFixture3x3
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.
DepthwiseConvolutionLayerValidationQuantizedFixture< Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T > NEDepthwiseConvolutionLayerQuantizedFixture3x3
Calculate required padding.