31 #include "tests/datasets/LargeConvolutionLayerDataset.h" 32 #include "tests/datasets/SmallConvolutionLayerDataset.h" 33 #include "tests/datasets/TinyConvolutionLayerDataset.h" 38 #include "tests/validation/fixtures/ConvolutionLayerFixture.h" 48 constexpr AbsoluteTolerance<float> absolute_tolerance_float(0.0001f);
49 RelativeTolerance<float> tolerance_f32(0.05f);
51 constexpr AbsoluteTolerance<float> tolerance_fixed(1.0f);
52 constexpr AbsoluteTolerance<float> tolerance_qasymm8(0.0);
53 constexpr
float tolerance_num = 0.07f;
66 ActivationLayerInfo(),
141 &weights_info.clone()->set_is_resizable(
true),
142 &output_info.clone()->set_is_resizable(
true),
conv_info,
156 ActivationFunctionsDataset),
167 CLTensor bias = create_tensor<CLTensor>(bias_shape, bias_data_type, 1, fixed_point_position,
QuantizationInfo(2.f / 255.f, 127));
176 const QuantizationInfo weights_quantization_info = weights.info()->quantization_info();
189 validate(weights.info()->valid_region(), weights_valid_region);
190 validate(bias.info()->valid_region(), bias_valid_region);
200 template <
typename T>
207 framework::dataset::
make("ReshapeWeights", {
true })),
211 ActivationFunctionsDataset))
222 ActivationFunctionsDataset))
232 framework::dataset::
make("ReshapeWeights", {
true })),
236 ActivationFunctionsDataset))
247 ActivationFunctionsDataset))
250 validate(
CLAccessor(_target), _reference, tolerance_f32, 0.f, absolute_tolerance_float);
255 template <
typename T>
262 framework::dataset::
make("ReshapeWeights", {
true })),
266 ActivationFunctionsDataset))
277 ActivationFunctionsDataset))
287 framework::dataset::
make("ReshapeWeights", {
true })),
291 ActivationFunctionsDataset))
302 ActivationFunctionsDataset))
310 template <
typename T>
324 framework::dataset::
make("ReshapeWeights", {
true })),
quantized, symmetric fixed-point 16-bit number
ConvolutionValidationFixture< CLTensor, CLAccessor, CLGEMMConvolutionLayer, T > CLGEMMConvolutionLayerFixture
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, const ActivationLayerInfo &act_info, const GPUTarget gpu_target, const Size2D &dilation=Size2D(1U, 1U), bool enable_fast_math=false)
Static function to check if given info will return the convolution called by CLConvolutionLayer.
bool is_resizable() const override
Flag indicating whether the size of the tensor can be changed.
ValidRegion valid_region() const override
Valid region of the tensor.
Basic function to compute the convolution layer.
QuantizationInfo quantization_info() const override
Get the quantization settings (scale and offset) of the tensor.
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.
TensorInfo * info() const override
Interface to be implemented by the child class to return the tensor's metadata.
ConvolutionMethod
Available ConvolutionMethod.
Activation Layer Information class.
src info() -> set_format(Format::S16)
This file contains all available output stages for GEMMLowp on OpenCL.
1 channel, 1 F16 per channel
#define TEST_SUITE(SUITE_NAME)
Convolution Layer Weights Information class.
void configure(const ICLTensor *input, const ICLTensor *weights, const ICLTensor *biases, ICLTensor *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.
1 channel, 1 S32 per channel
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsoluteDifferenceFixture< uint8_t >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), AbsoluteDifferenceU8Dataset))
validate(dst.info() ->valid_region(), dst_valid_region)
DatasetMode
Possible dataset modes.
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.
Accessor implementation for CLTensor objects.
const auto QuantizedActivationFunctionsDataset
Input data sets.
Padding and stride information class.
Num samples, channels, height, width.
bool is_data_type_quantized_asymmetric(DataType dt)
Check if a given data type is of asymmetric quantized type.
Convolution using Winograd.
DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), AbsoluteDifferenceU8Dataset), shape, data_type0, data_type1, output_data_type)
Lower and Upper Bounded Rectifier ( )
ConvolutionValidationFixedPointFixture< CLTensor, CLAccessor, CLGEMMConvolutionLayer, T > CLGEMMConvolutionLayerFixedPointFixture
Upper Bounded Rectifier ( )
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.
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.
ConvolutionValidationQuantizedFixture< CLTensor, CLAccessor, CLGEMMConvolutionLayer, T > CLGEMMConvolutionLayerQuantizedFixture
Basic implementation of the OpenCL tensor interface.