24.02.1
|
Go to the documentation of this file.
24 #ifndef ACL_TESTS_VALIDATION_HELPERS_H
25 #define ACL_TESTS_VALIDATION_HELPERS_H
37 #include <type_traits>
79 std::pair<T, T> bounds;
85 using namespace half_float::literal;
89 case ActivationLayerInfo::ActivationFunction::TANH:
90 case ActivationLayerInfo::ActivationFunction::SQUARE:
91 case ActivationLayerInfo::ActivationFunction::LOGISTIC:
92 case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
94 bounds = std::make_pair(-2._h, 2._h);
96 case ActivationLayerInfo::ActivationFunction::SQRT:
98 bounds = std::make_pair(0._h, 128._h);
101 bounds = std::make_pair(-255._h, 255._h);
109 case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
111 bounds = std::make_pair(-40.f, 40.f);
113 case ActivationLayerInfo::ActivationFunction::SQRT:
115 bounds = std::make_pair(0.f, 255.f);
118 bounds = std::make_pair(-255.f, 255.f);
135 template <
typename T>
146 template <
typename T>
155 template <
typename T>
165 template <
typename T>
175 template <
typename T>
184 template <
typename T>
195 template <
typename T>
204 template <
typename T>
262 float bias_fraction);
279 float bias_fraction);
299 #endif // ACL_TESTS_VALIDATION_HELPERS_H
void zeros(SimpleTensor< T > &in, const Coordinates &anchor, const TensorShape &shape)
Fill with zeros the input tensor in the area defined by anchor and shape.
SimpleTensor< float > src
void matrix_multiply(const SimpleTensor< T > &a, const SimpleTensor< T > &b, SimpleTensor< T > &out)
Matrix multiply between 2 float simple tensors.
Quantization information.
void add_padding_x(std::initializer_list< ITensor * > tensors, const DataLayout &data_layout, bool only_right_pad)
Add random padding along the X axis (between 1 and 16 columns per side) to all the input tensors.
DataLayout
[DataLayout enum definition]
Helper struct to store the hints for.
@ NHWC
Num samples, height, width, channels.
SimpleTensor< float > convert_from_symmetric(const SimpleTensor< int16_t > &src)
std::pair< int, int > get_symm_quantized_per_channel_bounds(const QuantizationInfo &quant_info, float min, float max, size_t channel_id)
Helper function to compute symmetric quantized min and max bounds.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
std::pair< T, T > get_activation_layer_test_bounds(ActivationLayerInfo::ActivationFunction activation, DataType data_type)
Helper function to get the testing range for each activation layer.
SimpleTensor< float > convert_from_asymmetric(const SimpleTensor< uint8_t > &src)
QuantizationHint suggest_mac_dst_q_info_and_bias(const QuantizationInfo &a_q_info, const QuantizationInfo &b_q_info, int32_t K, DataType data_type, float bias_fraction, int num_sd)
For a multiply-accumulate (mac), given the Lhs/Rhs vector quantization informations and the dot produ...
std::pair< int, int > get_quantized_bounds(const QuantizationInfo &quant_info, float min, float max)
Helper function to compute quantized min and max bounds.
SimpleTensor< int16_t > convert_to_symmetric(const SimpleTensor< float > &src, const QuantizationInfo &quantization_info)
SimpleTensor< T > tile(const SimpleTensor< T > &src, const Multiples &multiples)
SimpleTensor< uint8_t > convert_to_asymmetric(const SimpleTensor< float > &src, const QuantizationInfo &quantization_info)
half_float::half half
16-bit floating point type
ActivationFunction
Available activation functions.
QuantizationHint suggest_matmul_dst_q_info_and_bias(const QuantizationInfo &lhs_q_info, const QuantizationInfo &rhs_q_info, int32_t m, int32_t n, int32_t k, DataType data_type, float bias_fraction)
For a matrix multiplication, given the Lhs/Rhs matrix quantization informations and the matrix multip...
std::pair< int, int > get_quantized_qasymm8_signed_bounds(const QuantizationInfo &quant_info, float min, float max)
Helper function to compute asymmetric quantized signed min and max bounds.
void transpose_matrix(const SimpleTensor< T > &in, SimpleTensor< T > &out)
Transpose matrix.
const DataLayout data_layout
Simple tensor object that stores elements in a consecutive chunk of memory.
void get_tile(const SimpleTensor< T > &in, SimpleTensor< T > &tile, const Coordinates &coord)
Get a 2D tile from a tensor.
Copyright (c) 2017-2024 Arm Limited.
@ F16
16-bit floating-point number
QuantizationHint suggest_conv_dst_q_info_and_bias(const QuantizationInfo &in_q_info, const QuantizationInfo &weight_q_info, int32_t height, int32_t width, int32_t channels, DataType data_type, float bias_fraction)
For 2d convolution, given the Lhs/Rhs matrix quantization informations and the convolution dimension,...
@ F32
32-bit floating-point number
DataType
Available data types.