43 template <
typename TensorType,
typename AccessorType,
typename FunctionType,
typename T>
50 template <
typename...>
51 void setup(
TensorShape input_shape,
int stride_x,
int stride_y,
int pad_x,
int pad_y,
unsigned int kernel_size,
unsigned int num_kernels,
54 _fractional_bits = fractional_bits;
55 _quantization_info = quantization_info;
58 const TensorShape weights_shape(kernel_size, kernel_size, input_shape.
z(), num_kernels);
64 _target = compute_target(input_shape, weights_shape, bias_shape, output_shape, info, data_type, bias_data_type, fractional_bits, quantization_info);
65 _reference = compute_reference(input_shape, weights_shape, bias_shape, output_shape, info, data_type, bias_data_type, fractional_bits, quantization_info);
68 template <
typename...>
72 _fractional_bits = fractional_bits;
73 _quantization_info = quantization_info;
78 _target = compute_target(input_shape, weights_shape, bias_shape, output_shape, info, data_type, bias_data_type, fractional_bits, quantization_info);
79 _reference = compute_reference(input_shape, weights_shape, bias_shape, output_shape, info, data_type, bias_data_type, fractional_bits, quantization_info);
84 void fill(
U &&tensor,
int i)
86 switch(tensor.data_type())
90 std::uniform_int_distribution<uint8_t> distribution(0, 50);
91 library->fill(tensor, distribution, i);
97 std::uniform_real_distribution<> distribution(-1.0f, 1.0f);
98 library->fill(tensor, distribution, i);
103 std::uniform_int_distribution<int32_t> distribution(-5, 5);
104 library->fill(tensor, distribution, i);
108 library->fill_tensor_uniform(tensor, i);
116 TensorType
src = create_tensor<TensorType>(input_shape,
data_type, 1, fixed_point_position, quantization_info);
117 TensorType weights = create_tensor<TensorType>(weights_shape,
data_type, 1, fixed_point_position, quantization_info);
118 TensorType bias = create_tensor<TensorType>(bias_shape, bias_data_type, 1, fixed_point_position, quantization_info);
123 conv.configure(&src, &weights, &bias, &dst, info);
131 src.allocator()->allocate();
132 weights.allocator()->allocate();
133 bias.allocator()->allocate();
134 dst.allocator()->allocate();
142 fill(AccessorType(src), 0);
143 fill(AccessorType(weights), 1);
144 fill(AccessorType(bias), 2);
158 SimpleTensor<TBias> bias{ bias_shape, bias_data_type, 1, fixed_point_position, quantization_info };
168 TensorType _target{};
170 int _fractional_bits{};
178 const std::pair<unsigned int, unsigned int> scaled_dims =
scaled_dimensions(in_shape.
x(),
183 out_shape.
set(0, scaled_dims.first);
184 out_shape.
set(1, scaled_dims.second);
185 out_shape.
set(2, kernel_shape[3]);
190 template <
typename TensorType,
typename AccessorType,
typename FunctionType,
typename T>
194 template <
typename...>
197 DirectConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(input_shape, stride_x, stride_y, pad_x, pad_y, kernel_size, num_kernels, data_type, 0,
QuantizationInfo());
201 template <
typename TensorType,
typename AccessorType,
typename FunctionType,
typename T>
205 template <
typename...>
206 void setup(
TensorShape input_shape,
int stride_x,
int stride_y,
int pad_x,
int pad_y,
unsigned int kernel_size,
unsigned int num_kernels,
DataType data_type,
int fractional_bits)
208 DirectConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(input_shape, stride_x, stride_y, pad_x, pad_y, kernel_size, num_kernels, data_type, fractional_bits,
213 template <
typename TensorType,
typename AccessorType,
typename FunctionType,
typename T>
217 template <
typename...>
220 DirectConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(input_shape, stride_x, stride_y, pad_x, pad_y, kernel_size, num_kernels, data_type, 0, quantization_info);
224 template <
typename TensorType,
typename AccessorType,
typename FunctionType,
typename T>
228 template <
typename...>
232 DirectConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(input_shape, weights_shape, bias_shape, output_shape, info, data_type, 0, quantization_info);
236 template <
typename TensorType,
typename AccessorType,
typename FunctionType,
typename T>
240 template <
typename...>
244 DirectConvolutionValidationGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(input_shape, weights_shape, bias_shape, output_shape, info, data_type, 0,
QuantizationInfo());
T z() const
Alias to access the size of the third dimension.
1 channel, 1 F32 per channel
void setup(TensorShape input_shape, int stride_x, int stride_y, int pad_x, int pad_y, unsigned int kernel_size, unsigned int num_kernels, DataType data_type, QuantizationInfo quantization_info)
src info() -> set_format(Format::S16)
This file contains all available output stages for GEMMLowp on OpenCL.
1 channel, 1 F16 per channel
T x() const
Alias to access the size of the first dimension.
1 channel, 1 S32 per channel
void setup(TensorShape input_shape, int stride_x, int stride_y, int pad_x, int pad_y, unsigned int kernel_size, unsigned int num_kernels, DataType data_type, int fractional_bits, QuantizationInfo quantization_info)
void setup(TensorShape input_shape, int stride_x, int stride_y, int pad_x, int pad_y, unsigned int kernel_size, unsigned int num_kernels, DataType data_type, int fractional_bits)
std::unique_ptr< AssetsLibrary > library
void setup()
Setup function.
Padding and stride information class.
void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info, DataType data_type, int fractional_bits, QuantizationInfo quantization_info)
bool is_data_type_quantized_asymmetric(DataType dt)
Check if a given data type is of asymmetric quantized type.
void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info, DataType data_type, QuantizationInfo quantization_info)
Simple tensor object that stores elements in a consecutive chunk of memory.
typename std::conditional< std::is_same< typename std::decay< T >::type, uint8_t >::value, int32_t, T >::type TBias
TensorShape & set(size_t dimension, size_t value)
Accessor to set the value of one of the dimensions.
void setup(TensorShape input_shape, TensorShape weights_shape, TensorShape bias_shape, TensorShape output_shape, PadStrideInfo info, DataType data_type)
T y() const
Alias to access the size of the second dimension.
const std::pair< unsigned int, unsigned int > scaled_dimensions(unsigned int width, unsigned int height, unsigned int kernel_width, unsigned int kernel_height, const PadStrideInfo &pad_stride_info)
Returns expected width and height of output scaled tensor depending on dimensions rounding mode...
ARM_COMPUTE_EXPECT(src.info() ->is_resizable(), framework::LogLevel::ERRORS)
void setup(TensorShape input_shape, int stride_x, int stride_y, int pad_x, int pad_y, unsigned int kernel_size, unsigned int num_kernels, DataType data_type)
Quantization settings (used for QASYMM8 data type)
DataType
Available data types.
convolution configure & src