Compute Library
 21.08
arm_compute::test::validation::reference Namespace Reference

Enumerations

enum  ArithmeticOperation { ADD, SUB }
 Arithmetic operation types. More...
 
enum  FFTDirection { Forward, Inverse }
 
enum  WinogradTransformType { INPUT, FILTER, OUTPUT }
 Winograd transform type. More...
 

Functions

template<typename T >
SimpleTensor< T > absolute_difference (const SimpleTensor< T > &src1, const SimpleTensor< T > &src2, DataType dst_data_type)
 
template SimpleTensor< uint8_t > absolute_difference (const SimpleTensor< uint8_t > &src1, const SimpleTensor< uint8_t > &src2, DataType dst_data_type)
 
template SimpleTensor< int16_t > absolute_difference (const SimpleTensor< int16_t > &src1, const SimpleTensor< int16_t > &src2, DataType dst_data_type)
 
template SimpleTensor< int8_t > absolute_difference (const SimpleTensor< int8_t > &src1, const SimpleTensor< int8_t > &src2, DataType dst_data_type)
 
template<typename T1 , typename T2 >
SimpleTensor< T2 > accumulate (const SimpleTensor< T1 > &src, DataType output_data_type)
 
template<typename T1 , typename T2 >
SimpleTensor< T2 > accumulate_weighted (const SimpleTensor< T1 > &src, float alpha, DataType output_data_type)
 
template<typename T1 , typename T2 >
SimpleTensor< T2 > accumulate_squared (const SimpleTensor< T1 > &src, uint32_t shift, DataType output_data_type)
 
template SimpleTensor< int16_t > accumulate (const SimpleTensor< uint8_t > &src, DataType output_data_type)
 
template SimpleTensor< uint8_t > accumulate_weighted (const SimpleTensor< uint8_t > &src, float alpha, DataType output_data_type)
 
template SimpleTensor< int16_t > accumulate_squared (const SimpleTensor< uint8_t > &src, uint32_t shift, DataType output_data_type)
 
template<typename T >
SimpleTensor< T > activation_layer (const SimpleTensor< T > &src, ActivationLayerInfo info, const QuantizationInfo &oq_info)
 
template<>
SimpleTensor< uint8_t > activation_layer< uint8_t > (const SimpleTensor< uint8_t > &src, ActivationLayerInfo info, const QuantizationInfo &oq_info)
 
template<>
SimpleTensor< int8_t > activation_layer< int8_t > (const SimpleTensor< int8_t > &src, ActivationLayerInfo info, const QuantizationInfo &oq_info)
 
template<>
SimpleTensor< int16_t > activation_layer< int16_t > (const SimpleTensor< int16_t > &src, ActivationLayerInfo info, const QuantizationInfo &oq_info)
 
template SimpleTensor< int32_t > activation_layer (const SimpleTensor< int32_t > &src, ActivationLayerInfo info, const QuantizationInfo &oq_info)
 
template SimpleTensor< float > activation_layer (const SimpleTensor< float > &src, ActivationLayerInfo info, const QuantizationInfo &oq_info)
 
template SimpleTensor< halfactivation_layer (const SimpleTensor< half > &src, ActivationLayerInfo info, const QuantizationInfo &oq_info)
 
template<typename T >
activate_float (T x, T a, T b, ActivationLayerInfo::ActivationFunction activation)
 
template<typename T >
SimpleTensor< T > arithmetic_division (const SimpleTensor< T > &src1, const SimpleTensor< T > &src2, DataType data_type)
 
template SimpleTensor< halfarithmetic_division (const SimpleTensor< half > &src1, const SimpleTensor< half > &src2, DataType data_type)
 
template SimpleTensor< float > arithmetic_division (const SimpleTensor< float > &src1, const SimpleTensor< float > &src2, DataType data_type)
 
template<typename T >
SimpleTensor< T > arithmetic_operation (ArithmeticOperation op, const SimpleTensor< T > &src1, const SimpleTensor< T > &src2, SimpleTensor< T > &dst, ConvertPolicy convert_policy)
 
template<>
SimpleTensor< uint8_t > arithmetic_operation (ArithmeticOperation op, const SimpleTensor< uint8_t > &src1, const SimpleTensor< uint8_t > &src2, SimpleTensor< uint8_t > &dst, ConvertPolicy convert_policy)
 
template<>
SimpleTensor< int8_t > arithmetic_operation (ArithmeticOperation op, const SimpleTensor< int8_t > &src1, const SimpleTensor< int8_t > &src2, SimpleTensor< int8_t > &dst, ConvertPolicy convert_policy)
 
template<>
SimpleTensor< int16_t > arithmetic_operation (ArithmeticOperation op, const SimpleTensor< int16_t > &src1, const SimpleTensor< int16_t > &src2, SimpleTensor< int16_t > &dst, ConvertPolicy convert_policy)
 
template SimpleTensor< int32_t > arithmetic_operation (ArithmeticOperation op, const SimpleTensor< int32_t > &src1, const SimpleTensor< int32_t > &src2, SimpleTensor< int32_t > &dst, ConvertPolicy convert_policy)
 
template SimpleTensor< halfarithmetic_operation (ArithmeticOperation op, const SimpleTensor< half > &src1, const SimpleTensor< half > &src2, SimpleTensor< half > &dst, ConvertPolicy convert_policy)
 
template SimpleTensor< float > arithmetic_operation (ArithmeticOperation op, const SimpleTensor< float > &src1, const SimpleTensor< float > &src2, SimpleTensor< float > &dst, ConvertPolicy convert_policy)
 
template<typename T >
SimpleTensor< T > arithmetic_operation (ArithmeticOperation op, const SimpleTensor< T > &src1, const SimpleTensor< T > &src2, DataType dst_data_type, ConvertPolicy convert_policy)
 
template SimpleTensor< int32_t > arithmetic_operation (ArithmeticOperation op, const SimpleTensor< int32_t > &src1, const SimpleTensor< int32_t > &src2, DataType dst_data_type, ConvertPolicy convert_policy)
 
template SimpleTensor< int16_t > arithmetic_operation (ArithmeticOperation op, const SimpleTensor< int16_t > &src1, const SimpleTensor< int16_t > &src2, DataType dst_data_type, ConvertPolicy convert_policy)
 
template SimpleTensor< int8_t > arithmetic_operation (ArithmeticOperation op, const SimpleTensor< int8_t > &src1, const SimpleTensor< int8_t > &src2, DataType dst_data_type, ConvertPolicy convert_policy)
 
template SimpleTensor< halfarithmetic_operation (ArithmeticOperation op, const SimpleTensor< half > &src1, const SimpleTensor< half > &src2, DataType dst_data_type, ConvertPolicy convert_policy)
 
template SimpleTensor< float > arithmetic_operation (ArithmeticOperation op, const SimpleTensor< float > &src1, const SimpleTensor< float > &src2, DataType dst_data_type, ConvertPolicy convert_policy)
 
template<typename T , typename std::enable_if< is_floating_point< T >::value, int >::type * >
SimpleTensor< T > batch_normalization_layer (const SimpleTensor< T > &src, const SimpleTensor< T > &mean, const SimpleTensor< T > &var, const SimpleTensor< T > &beta, const SimpleTensor< T > &gamma, float epsilon, ActivationLayerInfo act_info)
 
template SimpleTensor< float > batch_normalization_layer (const SimpleTensor< float > &src, const SimpleTensor< float > &mean, const SimpleTensor< float > &var, const SimpleTensor< float > &beta, const SimpleTensor< float > &gamma, float epsilon, ActivationLayerInfo act_info)
 
template SimpleTensor< halfbatch_normalization_layer (const SimpleTensor< half > &src, const SimpleTensor< half > &mean, const SimpleTensor< half > &var, const SimpleTensor< half > &beta, const SimpleTensor< half > &gamma, float epsilon, ActivationLayerInfo act_info)
 
template<typename T >
SimpleTensor< T > batch_to_space (const SimpleTensor< T > &src, const SimpleTensor< int32_t > &block_shape, const TensorShape &dst_shape)
 
template SimpleTensor< float > batch_to_space (const SimpleTensor< float > &src, const SimpleTensor< int32_t > &block_shape, const TensorShape &dst_shape)
 
template SimpleTensor< halfbatch_to_space (const SimpleTensor< half > &src, const SimpleTensor< int32_t > &block_shape, const TensorShape &dst_shape)
 
template<typename T >
SimpleTensor< T > bitwise_and (const SimpleTensor< T > &src1, const SimpleTensor< T > &src2)
 
template SimpleTensor< uint8_t > bitwise_and (const SimpleTensor< uint8_t > &src1, const SimpleTensor< uint8_t > &src2)
 
template<typename T >
SimpleTensor< T > bitwise_not (const SimpleTensor< T > &src)
 
template SimpleTensor< uint8_t > bitwise_not (const SimpleTensor< uint8_t > &src)
 
template<typename T >
SimpleTensor< T > bitwise_or (const SimpleTensor< T > &src1, const SimpleTensor< T > &src2)
 
template SimpleTensor< uint8_t > bitwise_or (const SimpleTensor< uint8_t > &src1, const SimpleTensor< uint8_t > &src2)
 
template<typename T >
SimpleTensor< T > bitwise_xor (const SimpleTensor< T > &src1, const SimpleTensor< T > &src2)
 
template SimpleTensor< uint8_t > bitwise_xor (const SimpleTensor< uint8_t > &src1, const SimpleTensor< uint8_t > &src2)
 
template<typename T , typename TDeltas >
SimpleTensor< T > bounding_box_transform (const SimpleTensor< T > &boxes, const SimpleTensor< TDeltas > &deltas, const BoundingBoxTransformInfo &info)
 
template SimpleTensor< float > bounding_box_transform (const SimpleTensor< float > &boxes, const SimpleTensor< float > &deltas, const BoundingBoxTransformInfo &info)
 
template SimpleTensor< halfbounding_box_transform (const SimpleTensor< half > &boxes, const SimpleTensor< half > &deltas, const BoundingBoxTransformInfo &info)
 
template<>
SimpleTensor< uint16_t > bounding_box_transform (const SimpleTensor< uint16_t > &boxes, const SimpleTensor< uint8_t > &deltas, const BoundingBoxTransformInfo &info)
 
template<typename T >
SimpleTensor< T > channel_shuffle (const SimpleTensor< T > &src, int num_groups)
 
template SimpleTensor< uint8_t > channel_shuffle (const SimpleTensor< uint8_t > &src, int num_groups)
 
template SimpleTensor< uint16_t > channel_shuffle (const SimpleTensor< uint16_t > &src, int num_groups)
 
template SimpleTensor< uint32_t > channel_shuffle (const SimpleTensor< uint32_t > &src, int num_groups)
 
template SimpleTensor< halfchannel_shuffle (const SimpleTensor< half > &src, int num_groups)
 
template SimpleTensor< float > channel_shuffle (const SimpleTensor< float > &src, int num_groups)
 
template<typename T >
SimpleTensor< T > col2im (const SimpleTensor< T > &src, const TensorShape &dst_shape, unsigned int num_groups)
 
template SimpleTensor< float > col2im (const SimpleTensor< float > &src, const TensorShape &dst_shape, unsigned int num_groups)
 
template SimpleTensor< halfcol2im (const SimpleTensor< half > &src, const TensorShape &dst_shape, unsigned int num_groups)
 
template SimpleTensor< uint8_t > col2im (const SimpleTensor< uint8_t > &src, const TensorShape &dst_shape, unsigned int num_groups)
 
template<typename T >
SimpleTensor< uint8_t > compare (ComparisonOperation op, const SimpleTensor< T > &src1, const SimpleTensor< T > &src2)
 
template<>
SimpleTensor< uint8_t > compare (ComparisonOperation op, const SimpleTensor< uint8_t > &src1, const SimpleTensor< uint8_t > &src2)
 
template<>
SimpleTensor< uint8_t > compare (ComparisonOperation op, const SimpleTensor< int8_t > &src1, const SimpleTensor< int8_t > &src2)
 
template SimpleTensor< uint8_t > compare (ComparisonOperation op, const SimpleTensor< half > &src1, const SimpleTensor< half > &src2)
 
template SimpleTensor< uint8_t > compare (ComparisonOperation op, const SimpleTensor< float > &src1, const SimpleTensor< float > &src2)
 
template<typename T >
SimpleTensor< T > compute_all_anchors (const SimpleTensor< T > &anchors, const ComputeAnchorsInfo &info)
 
template SimpleTensor< float > compute_all_anchors (const SimpleTensor< float > &anchors, const ComputeAnchorsInfo &info)
 
template SimpleTensor< halfcompute_all_anchors (const SimpleTensor< half > &anchors, const ComputeAnchorsInfo &info)
 
template<>
SimpleTensor< int16_t > compute_all_anchors (const SimpleTensor< int16_t > &anchors, const ComputeAnchorsInfo &info)
 
template<typename T >
SimpleTensor< T > concatenate_layer (std::vector< SimpleTensor< T >> &srcs, SimpleTensor< T > &dst, unsigned int axis)
 
template SimpleTensor< float > concatenate_layer (std::vector< SimpleTensor< float >> &srcs, SimpleTensor< float > &dst, unsigned int axis)
 
template SimpleTensor< halfconcatenate_layer (std::vector< SimpleTensor< half >> &srcs, SimpleTensor< half > &dst, unsigned int axis)
 
template SimpleTensor< uint8_t > concatenate_layer (std::vector< SimpleTensor< uint8_t >> &srcs, SimpleTensor< uint8_t > &dst, unsigned int axis)
 
template SimpleTensor< int8_t > concatenate_layer (std::vector< SimpleTensor< int8_t >> &srcs, SimpleTensor< int8_t > &dst, unsigned int axis)
 
template<typename T >
SimpleTensor< T > convert_fully_connected_weights (const SimpleTensor< T > &src, const TensorShape &original_input_shape, const DataLayout training_data_layout)
 
template SimpleTensor< uint8_t > convert_fully_connected_weights (const SimpleTensor< uint8_t > &src, const TensorShape &original_input_shape, const DataLayout training_data_layout)
 
template SimpleTensor< halfconvert_fully_connected_weights (const SimpleTensor< half > &src, const TensorShape &original_input_shape, const DataLayout training_data_layout)
 
template SimpleTensor< float > convert_fully_connected_weights (const SimpleTensor< float > &src, const TensorShape &original_input_shape, const DataLayout training_data_layout)
 
template<typename T , typename TW , typename TB >
SimpleTensor< T > convolution_layer_nchw (const SimpleTensor< T > &src, const SimpleTensor< TW > &weights, const SimpleTensor< TB > &bias, SimpleTensor< T > &dst, const PadStrideInfo &info, const Size2D &dilation, unsigned int num_groups)
 
template<typename T , typename TW , typename TB >
SimpleTensor< T > convolution_layer (const SimpleTensor< T > &src, const SimpleTensor< TW > &weights, const SimpleTensor< TB > &bias, const TensorShape &output_shape, const PadStrideInfo &info, const Size2D &dilation, unsigned int num_groups, QuantizationInfo out_quant_info)
 
template SimpleTensor< float > convolution_layer (const SimpleTensor< float > &src, const SimpleTensor< float > &weights, const SimpleTensor< float > &bias, const TensorShape &output_shape, const PadStrideInfo &info, const Size2D &dilation, unsigned int num_groups, QuantizationInfo out_quant_info)
 
template SimpleTensor< halfconvolution_layer (const SimpleTensor< half > &src, const SimpleTensor< half > &weights, const SimpleTensor< half > &bias, const TensorShape &output_shape, const PadStrideInfo &info, const Size2D &dilation, unsigned int num_groups, QuantizationInfo out_quant_info)
 
template SimpleTensor< uint8_t > convolution_layer (const SimpleTensor< uint8_t > &src, const SimpleTensor< uint8_t > &weights, const SimpleTensor< int32_t > &bias, const TensorShape &output_shape, const PadStrideInfo &info, const Size2D &dilation, unsigned int num_groups, QuantizationInfo out_quant_info)
 
template SimpleTensor< uint8_t > convolution_layer (const SimpleTensor< uint8_t > &src, const SimpleTensor< int8_t > &weights, const SimpleTensor< int32_t > &bias, const TensorShape &output_shape, const PadStrideInfo &info, const Size2D &dilation, unsigned int num_groups, QuantizationInfo out_quant_info)
 
template SimpleTensor< int8_t > convolution_layer (const SimpleTensor< int8_t > &src, const SimpleTensor< int8_t > &weights, const SimpleTensor< int32_t > &bias, const TensorShape &output_shape, const PadStrideInfo &info, const Size2D &dilation, unsigned int num_groups, QuantizationInfo out_quant_info)
 
template<typename T >
SimpleTensor< T > copy (const SimpleTensor< T > &src, const TensorShape &output_shape)
 
template SimpleTensor< uint8_t > copy (const SimpleTensor< uint8_t > &src, const TensorShape &output_shape)
 
template SimpleTensor< int8_t > copy (const SimpleTensor< int8_t > &src, const TensorShape &output_shape)
 
template SimpleTensor< uint16_t > copy (const SimpleTensor< uint16_t > &src, const TensorShape &output_shape)
 
template SimpleTensor< int16_t > copy (const SimpleTensor< int16_t > &src, const TensorShape &output_shape)
 
template SimpleTensor< uint32_t > copy (const SimpleTensor< uint32_t > &src, const TensorShape &output_shape)
 
template SimpleTensor< int32_t > copy (const SimpleTensor< int32_t > &src, const TensorShape &output_shape)
 
template SimpleTensor< halfcopy (const SimpleTensor< half > &src, const TensorShape &output_shape)
 
template SimpleTensor< float > copy (const SimpleTensor< float > &src, const TensorShape &output_shape)
 
template<typename T >
SimpleTensor< float > crop_and_resize (const SimpleTensor< T > &src, const SimpleTensor< float > &boxes, SimpleTensor< int32_t > box_ind, Coordinates2D crop_size, InterpolationPolicy method, float extrapolation_value)
 
template SimpleTensor< float > crop_and_resize (const SimpleTensor< float > &src, const SimpleTensor< float > &boxes, SimpleTensor< int32_t > box_ind, Coordinates2D crop_size, InterpolationPolicy method, float extrapolation_value)
 
template SimpleTensor< float > crop_and_resize (const SimpleTensor< uint16_t > &src, const SimpleTensor< float > &boxes, SimpleTensor< int32_t > box_ind, Coordinates2D crop_size, InterpolationPolicy method, float extrapolation_value)
 
template SimpleTensor< float > crop_and_resize (const SimpleTensor< uint32_t > &src, const SimpleTensor< float > &boxes, SimpleTensor< int32_t > box_ind, Coordinates2D crop_size, InterpolationPolicy method, float extrapolation_value)
 
template SimpleTensor< float > crop_and_resize (const SimpleTensor< int16_t > &src, const SimpleTensor< float > &boxes, SimpleTensor< int32_t > box_ind, Coordinates2D crop_size, InterpolationPolicy method, float extrapolation_value)
 
template SimpleTensor< float > crop_and_resize (const SimpleTensor< int32_t > &src, const SimpleTensor< float > &boxes, SimpleTensor< int32_t > box_ind, Coordinates2D crop_size, InterpolationPolicy method, float extrapolation_value)
 
template SimpleTensor< float > crop_and_resize (const SimpleTensor< half > &src, const SimpleTensor< float > &boxes, SimpleTensor< int32_t > box_ind, Coordinates2D crop_size, InterpolationPolicy method, float extrapolation_value)
 
template SimpleTensor< float > crop_and_resize (const SimpleTensor< uint8_t > &src, const SimpleTensor< float > &boxes, SimpleTensor< int32_t > box_ind, Coordinates2D crop_size, InterpolationPolicy method, float extrapolation_value)
 
template<typename T , typename TW , typename TB >
SimpleTensor< T > deconvolution_layer (const SimpleTensor< T > &src, const SimpleTensor< TW > &weights, const SimpleTensor< TB > &bias, const TensorShape &output_shape, const PadStrideInfo &info, QuantizationInfo out_qinfo=QuantizationInfo())
 Deconvolution reference implementation. More...
 
template SimpleTensor< uint8_t > deconvolution_layer (const SimpleTensor< uint8_t > &src, const SimpleTensor< uint8_t > &weights, const SimpleTensor< int32_t > &bias, const TensorShape &output_shape, const PadStrideInfo &info, QuantizationInfo out_quant_info)
 
template SimpleTensor< uint8_t > deconvolution_layer (const SimpleTensor< uint8_t > &src, const SimpleTensor< int8_t > &weights, const SimpleTensor< int32_t > &bias, const TensorShape &output_shape, const PadStrideInfo &info, QuantizationInfo out_quant_info)
 
template SimpleTensor< int8_t > deconvolution_layer (const SimpleTensor< int8_t > &src, const SimpleTensor< int8_t > &weights, const SimpleTensor< int32_t > &bias, const TensorShape &output_shape, const PadStrideInfo &info, QuantizationInfo out_quant_info)
 
template SimpleTensor< float > deconvolution_layer (const SimpleTensor< float > &src, const SimpleTensor< float > &weights, const SimpleTensor< float > &bias, const TensorShape &output_shape, const PadStrideInfo &info, QuantizationInfo out_quant_info)
 
template SimpleTensor< halfdeconvolution_layer (const SimpleTensor< half > &src, const SimpleTensor< half > &weights, const SimpleTensor< half > &bias, const TensorShape &output_shape, const PadStrideInfo &info, QuantizationInfo out_quant_info)
 
template<typename T >
SimpleTensor< T > depthconcatenate_layer (const std::vector< SimpleTensor< T >> &srcs, SimpleTensor< T > &dst)
 
template SimpleTensor< uint8_t > depthconcatenate_layer (const std::vector< SimpleTensor< uint8_t >> &srcs, SimpleTensor< uint8_t > &dst)
 
template SimpleTensor< float > depthconcatenate_layer (const std::vector< SimpleTensor< float >> &srcs, SimpleTensor< float > &dst)
 
template SimpleTensor< halfdepthconcatenate_layer (const std::vector< SimpleTensor< half >> &srcs, SimpleTensor< half > &dst)
 
template<typename T1 , typename T2 , typename std::enable_if< std::is_integral< T1 >::value &&!std::is_same< T1, T2 >::value, int >::type >
SimpleTensor< T2 > depth_convert (const SimpleTensor< T1 > &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
 
template SimpleTensor< int8_t > depth_convert (const SimpleTensor< uint8_t > &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
 
template SimpleTensor< uint8_t > depth_convert (const SimpleTensor< int8_t > &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
 
template SimpleTensor< uint8_t > depth_convert (const SimpleTensor< uint16_t > &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
 
template SimpleTensor< uint8_t > depth_convert (const SimpleTensor< int16_t > &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
 
template SimpleTensor< uint8_t > depth_convert (const SimpleTensor< uint32_t > &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
 
template SimpleTensor< uint8_t > depth_convert (const SimpleTensor< int32_t > &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
 
template SimpleTensor< float > depth_convert (const SimpleTensor< bfloat16 > &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
 
template SimpleTensor< uint8_t > depth_convert (const SimpleTensor< half > &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
 
template SimpleTensor< uint8_t > depth_convert (const SimpleTensor< float > &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
 
template<typename T >
SimpleTensor< T > depth_to_space (const SimpleTensor< T > &src, const TensorShape &dst_shape, int32_t block_shape)
 
template SimpleTensor< float > depth_to_space (const SimpleTensor< float > &src, const TensorShape &dst_shape, int32_t block_shape)
 
template SimpleTensor< halfdepth_to_space (const SimpleTensor< half > &src, const TensorShape &dst_shape, int32_t block_shape)
 
template<>
SimpleTensor< float > depthwise_convolution (const SimpleTensor< float > &src, const SimpleTensor< float > &weights, const SimpleTensor< float > &biases, const TensorShape &dst_shape, const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation, const QuantizationInfo &out_quant_info)
 
template<>
SimpleTensor< halfdepthwise_convolution (const SimpleTensor< half > &src, const SimpleTensor< half > &weights, const SimpleTensor< half > &biases, const TensorShape &dst_shape, const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation, const QuantizationInfo &out_quant_info)
 
template<>
SimpleTensor< uint8_t > depthwise_convolution (const SimpleTensor< uint8_t > &src, const SimpleTensor< uint8_t > &weights, const SimpleTensor< int32_t > &biases, const TensorShape &dst_shape, const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation, const QuantizationInfo &out_quant_info)
 
template<>
SimpleTensor< uint8_t > depthwise_convolution (const SimpleTensor< uint8_t > &src, const SimpleTensor< int8_t > &weights, const SimpleTensor< int32_t > &biases, const TensorShape &dst_shape, const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation, const QuantizationInfo &out_quant_info)
 
template<>
SimpleTensor< int8_t > depthwise_convolution (const SimpleTensor< int8_t > &src, const SimpleTensor< int8_t > &weights, const SimpleTensor< int32_t > &biases, const TensorShape &dst_shape, const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation, const QuantizationInfo &out_quant_info)
 
template<typename T , typename TW , typename TB >
SimpleTensor< T > depthwise_convolution (const SimpleTensor< T > &src, const SimpleTensor< TW > &weights, const SimpleTensor< TB > &biases, const TensorShape &dst_shape, const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation=Size2D(1U, 1U), const QuantizationInfo &out_quant_info=QuantizationInfo(0.0f, 0))
 
template<typename T >
SimpleTensor< T > depthwise_separable_convolution_layer (const SimpleTensor< T > &src, const SimpleTensor< T > &depthwise_weights, const SimpleTensor< T > &depthwise_biases, const TensorShape &depthwise_out_shape, const SimpleTensor< T > &pointwise_weights, const SimpleTensor< T > &pointwise_biases, const TensorShape &dst_shape, const PadStrideInfo &depthwise_conv_info, const PadStrideInfo &pointwise_conv_info)
 
template<typename TOut , typename TIn >
SimpleTensor< TOut > dequantization_layer (const SimpleTensor< TIn > &src)
 
template SimpleTensor< halfdequantization_layer (const SimpleTensor< uint8_t > &src)
 
template SimpleTensor< halfdequantization_layer (const SimpleTensor< int8_t > &src)
 
template SimpleTensor< halfdequantization_layer (const SimpleTensor< int16_t > &src)
 
template<typename T >
SimpleTensor< T > rdft_1d (const SimpleTensor< T > &src)
 Performs an one dimensional DFT on a real input. More...
 
template<typename T >
SimpleTensor< T > ridft_1d (const SimpleTensor< T > &src, bool is_odd=false)
 Performs an one dimensional inverse DFT on a real input. More...
 
template<typename T >
SimpleTensor< T > dft_1d (const SimpleTensor< T > &src, FFTDirection direction)
 Performs an one dimensional DFT on a complex input. More...
 
template<typename T >
SimpleTensor< T > rdft_2d (const SimpleTensor< T > &src)
 Performs a two dimensional DFT on a real input. More...
 
template<typename T >
SimpleTensor< T > ridft_2d (const SimpleTensor< T > &src, bool is_odd=false)
 Performs a two dimensional inverse DFT on a real input. More...
 
template<typename T >
SimpleTensor< T > dft_2d (const SimpleTensor< T > &src, FFTDirection direction)
 Performs a two dimensional DFT on a complex input. More...
 
template<typename T >
SimpleTensor< T > conv2d_dft (const SimpleTensor< T > &src, const SimpleTensor< T > &w, const PadStrideInfo &conv_info)
 Performs and DFT based convolution on a real input. More...
 
template SimpleTensor< float > rdft_1d (const SimpleTensor< float > &src)
 
template SimpleTensor< float > ridft_1d (const SimpleTensor< float > &src, bool is_odd)
 
template SimpleTensor< float > dft_1d (const SimpleTensor< float > &src, FFTDirection direction)
 
template SimpleTensor< float > rdft_2d (const SimpleTensor< float > &src)
 
template SimpleTensor< float > ridft_2d (const SimpleTensor< float > &src, bool is_odd)
 
template SimpleTensor< float > dft_2d (const SimpleTensor< float > &src, FFTDirection direction)
 
template SimpleTensor< float > conv2d_dft (const SimpleTensor< float > &src, const SimpleTensor< float > &w, const PadStrideInfo &conv_info)
 
template SimpleTensor< halfrdft_1d (const SimpleTensor< half > &src)
 
template SimpleTensor< halfridft_1d (const SimpleTensor< half > &src, bool is_odd)
 
template SimpleTensor< halfdft_1d (const SimpleTensor< half > &src, FFTDirection direction)
 
template SimpleTensor< halfrdft_2d (const SimpleTensor< half > &src)
 
template SimpleTensor< halfridft_2d (const SimpleTensor< half > &src, bool is_odd)
 
template SimpleTensor< halfdft_2d (const SimpleTensor< half > &src, FFTDirection direction)
 
template SimpleTensor< halfconv2d_dft (const SimpleTensor< half > &src, const SimpleTensor< half > &w, const PadStrideInfo &conv_info)
 
template<typename T >
SimpleTensor< T > elementwise_unary (const SimpleTensor< T > &src, ElementWiseUnary op)
 
template SimpleTensor< float > elementwise_unary (const SimpleTensor< float > &src, ElementWiseUnary op)
 
template SimpleTensor< halfelementwise_unary (const SimpleTensor< half > &src, ElementWiseUnary op)
 
template SimpleTensor< int32_t > elementwise_unary (const SimpleTensor< int32_t > &src, ElementWiseUnary op)
 
template<typename T >
SimpleTensor< T > erode (const SimpleTensor< T > &src, BorderMode border_mode, T constant_border_value)
 
template SimpleTensor< uint8_t > erode (const SimpleTensor< uint8_t > &src, BorderMode border_mode, uint8_t constant_border_value)
 
template<typename T >
SimpleTensor< T > flatten_layer (const SimpleTensor< T > &src, const TensorShape &shape_flatten)
 
template SimpleTensor< float > flatten_layer (const SimpleTensor< float > &src, const TensorShape &shape_flatten)
 
template SimpleTensor< halfflatten_layer (const SimpleTensor< half > &src, const TensorShape &shape_flatten)
 
template<typename T >
SimpleTensor< T > floor_layer (const SimpleTensor< T > &src)
 
template SimpleTensor< halffloor_layer (const SimpleTensor< half > &src)
 
template SimpleTensor< float > floor_layer (const SimpleTensor< float > &src)
 
template<typename T , typename TB >
SimpleTensor< T > fully_connected_layer (const SimpleTensor< T > &src, const SimpleTensor< T > &weights, const SimpleTensor< TB > &bias, const TensorShape &dst_shape, QuantizationInfo out_quant_info)
 
template SimpleTensor< float > fully_connected_layer (const SimpleTensor< float > &src, const SimpleTensor< float > &weights, const SimpleTensor< float > &bias, const TensorShape &dst_shape, QuantizationInfo out_quant_info)
 
template SimpleTensor< halffully_connected_layer (const SimpleTensor< half > &src, const SimpleTensor< half > &weights, const SimpleTensor< half > &bias, const TensorShape &dst_shape, QuantizationInfo out_quant_info)
 
template SimpleTensor< uint8_t > fully_connected_layer (const SimpleTensor< uint8_t > &src, const SimpleTensor< uint8_t > &weights, const SimpleTensor< int32_t > &bias, const TensorShape &dst_shape, QuantizationInfo out_quant_info)
 
template SimpleTensor< int8_t > fully_connected_layer (const SimpleTensor< int8_t > &src, const SimpleTensor< int8_t > &weights, const SimpleTensor< int32_t > &bias, const TensorShape &dst_shape, QuantizationInfo out_quant_info)
 
template<typename T >
void fuse_batch_normalization_dwc_layer (const SimpleTensor< T > &w, const SimpleTensor< T > &mean, const SimpleTensor< T > &var, SimpleTensor< T > &w_fused, SimpleTensor< T > &b_fused, const SimpleTensor< T > &b, const SimpleTensor< T > &beta, const SimpleTensor< T > &gamma, float epsilon)
 
template<typename T >
void fuse_batch_normalization_conv_layer (const SimpleTensor< T > &w, const SimpleTensor< T > &mean, const SimpleTensor< T > &var, SimpleTensor< T > &w_fused, SimpleTensor< T > &b_fused, const SimpleTensor< T > &b, const SimpleTensor< T > &beta, const SimpleTensor< T > &gamma, float epsilon)
 
template void fuse_batch_normalization_dwc_layer (const SimpleTensor< float > &w, const SimpleTensor< float > &mean, const SimpleTensor< float > &var, SimpleTensor< float > &w_fused, SimpleTensor< float > &b_fused, const SimpleTensor< float > &b, const SimpleTensor< float > &beta, const SimpleTensor< float > &gamma, float epsilon)
 
template void fuse_batch_normalization_dwc_layer (const SimpleTensor< half > &w, const SimpleTensor< half > &mean, const SimpleTensor< half > &var, SimpleTensor< half > &w_fused, SimpleTensor< half > &b_fused, const SimpleTensor< half > &b, const SimpleTensor< half > &beta, const SimpleTensor< half > &gamma, float epsilon)
 
template void fuse_batch_normalization_conv_layer (const SimpleTensor< float > &w, const SimpleTensor< float > &mean, const SimpleTensor< float > &var, SimpleTensor< float > &w_fused, SimpleTensor< float > &b_fused, const SimpleTensor< float > &b, const SimpleTensor< float > &beta, const SimpleTensor< float > &gamma, float epsilon)
 
template void fuse_batch_normalization_conv_layer (const SimpleTensor< half > &w, const SimpleTensor< half > &mean, const SimpleTensor< half > &var, SimpleTensor< half > &w_fused, SimpleTensor< half > &b_fused, const SimpleTensor< half > &b, const SimpleTensor< half > &beta, const SimpleTensor< half > &gamma, float epsilon)
 
template<typename T >
SimpleTensor< T > gather (const SimpleTensor< T > &src, const SimpleTensor< uint32_t > &indices, uint32_t actual_axis)
 
template SimpleTensor< float > gather (const SimpleTensor< float > &src, const SimpleTensor< uint32_t > &indices, uint32_t actual_axis)
 
template SimpleTensor< halfgather (const SimpleTensor< half > &src, const SimpleTensor< uint32_t > &indices, uint32_t actual_axis)
 
template SimpleTensor< uint16_t > gather (const SimpleTensor< uint16_t > &src, const SimpleTensor< uint32_t > &indices, uint32_t actual_axis)
 
template SimpleTensor< uint8_t > gather (const SimpleTensor< uint8_t > &src, const SimpleTensor< uint32_t > &indices, uint32_t actual_axis)
 
template<typename T , typename std::enable_if< is_floating_point< T >::value, int >::type >
SimpleTensor< T > gemm (const SimpleTensor< T > &a, const SimpleTensor< T > &b, const SimpleTensor< T > &c, float alpha, float beta)
 
template<typename T , typename std::enable_if< is_floating_point< T >::value, int >::type >
SimpleTensor< T > gemm_mixed_precision (const SimpleTensor< T > &a, const SimpleTensor< T > &b, const SimpleTensor< T > &c, float alpha, float beta)
 
template SimpleTensor< float > gemm (const SimpleTensor< float > &a, const SimpleTensor< float > &b, const SimpleTensor< float > &c, float alpha, float beta)
 
template SimpleTensor< halfgemm (const SimpleTensor< half > &a, const SimpleTensor< half > &b, const SimpleTensor< half > &c, float alpha, float beta)
 
template SimpleTensor< halfgemm_mixed_precision (const SimpleTensor< half > &a, const SimpleTensor< half > &b, const SimpleTensor< half > &c, float alpha, float beta)
 
template<typename T >
SimpleTensor< T > gemm_interleave_4x4 (const SimpleTensor< T > &in, SimpleTensor< T > &out)
 
template<typename T >
safe_read (const SimpleTensor< T > &t, int y, int x)
 
template<typename T >
SimpleTensor< T > gemm_interleave_blocked (const SimpleTensor< T > &in, SimpleTensor< T > &out, int int_by, int block, bool transposed)
 
template SimpleTensor< uint8_t > gemm_interleave_blocked (const SimpleTensor< uint8_t > &in, SimpleTensor< uint8_t > &out, int int_by, int block, bool transposed)
 
template<typename T_out , typename T_in , typename T_in_1 >
SimpleTensor< T_out > gemmlowp_matrix_multiply_core (const SimpleTensor< T_in > &a, const SimpleTensor< T_in_1 > &b, TensorShape shape_c, int32_t a_offset, int32_t b_offset)
 
template<typename T1 , typename T2 , typename T3 >
SimpleTensor< T1 > gemmlowp (const SimpleTensor< T2 > &a, const SimpleTensor< T3 > &b, TensorShape shape_c)
 
template<typename TIn , typename TOut >
SimpleTensor< TOut > gemmlowp_quantize_down_scale (const SimpleTensor< TIn > &in, int32_t result_offset, std::vector< int32_t > result_mult_int, std::vector< int32_t > result_shift, int32_t min, int32_t max)
 
template<typename TIn , typename TOut >
SimpleTensor< TOut > gemmlowp_quantize_down_scale (const SimpleTensor< TIn > &in, const SimpleTensor< TIn > &bias, int32_t result_offset, std::vector< int32_t > result_mult_int, std::vector< int32_t > result_shift, int32_t min, int32_t max)
 
template<typename TIn , typename TOut >
SimpleTensor< TOut > gemmlowp_quantize_down_scale_by_fixedpoint (const SimpleTensor< TIn > &in, std::vector< int32_t > result_fixedpoint_multiplier, std::vector< int32_t > result_shift, int32_t result_offset_after_shift, int32_t min, int32_t max)
 
template<typename TIn , typename TOut >
SimpleTensor< TOut > gemmlowp_quantize_down_scale_by_fixedpoint (const SimpleTensor< TIn > &in, const SimpleTensor< TIn > &bias, std::vector< int32_t > result_fixedpoint_multiplier, std::vector< int32_t > result_shift, int32_t result_offset_after_shift, int32_t min, int32_t max)
 
template<typename TIn , typename TOut >
SimpleTensor< TOut > gemmlowp_quantize_down_scale_by_float (const SimpleTensor< TIn > &in, const SimpleTensor< TIn > &bias, std::vector< float_t > result_real_multiplier, int32_t result_offset, int32_t min, int32_t max)
 
template<typename TIn , typename TOut >
SimpleTensor< TOut > gemmlowp_quantize_down_scale_by_float (const SimpleTensor< TIn > &in, std::vector< float_t > result_real_multiplier, int32_t result_offset, int32_t min, int32_t max)
 
template SimpleTensor< uint8_t > gemmlowp_quantize_down_scale_by_float (const SimpleTensor< int32_t > &a, const SimpleTensor< int32_t > &b, std::vector< float_t > result_real_multiplier, int32_t result_offset, int32_t min, int32_t max)
 
template SimpleTensor< uint8_t > gemmlowp_quantize_down_scale_by_float (const SimpleTensor< int32_t > &a, std::vector< float_t > result_real_multiplier, int32_t result_offset, int32_t min, int32_t max)
 
template SimpleTensor< uint8_t > gemmlowp_quantize_down_scale_by_fixedpoint (const SimpleTensor< int32_t > &a, std::vector< int32_t > result_fixedpoint_multiplier, std::vector< int32_t > result_shift, int32_t result_offset_after_shift, int32_t min, int32_t max)
 
template SimpleTensor< uint8_t > gemmlowp_quantize_down_scale_by_fixedpoint (const SimpleTensor< int32_t > &a, const SimpleTensor< int32_t > &b, std::vector< int32_t > result_fixedpoint_multiplier, std::vector< int32_t > result_shift, int32_t result_offset_after_shift, int32_t min, int32_t max)
 
template SimpleTensor< uint8_t > gemmlowp_quantize_down_scale (const SimpleTensor< int32_t > &a, int32_t result_offset, std::vector< int32_t > result_mult_int, std::vector< int32_t > result_shift, int32_t min, int32_t max)
 
template SimpleTensor< uint8_t > gemmlowp_quantize_down_scale (const SimpleTensor< int32_t > &a, const SimpleTensor< int32_t > &b, int32_t result_offset, std::vector< int32_t > result_mult_int, std::vector< int32_t > result_shift, int32_t min, int32_t max)
 
template SimpleTensor< int32_t > gemmlowp_matrix_multiply_core (const SimpleTensor< int8_t > &a, const SimpleTensor< int8_t > &b, TensorShape shape_c, int32_t a_offset, int32_t b_offset)
 
template SimpleTensor< int32_t > gemmlowp_matrix_multiply_core (const SimpleTensor< uint8_t > &a, const SimpleTensor< uint8_t > &b, TensorShape shape_c, int32_t a_offset, int32_t b_offset)
 
template SimpleTensor< int32_t > gemmlowp< int32_t, int8_t, int8_t > (const SimpleTensor< int8_t > &a, const SimpleTensor< int8_t > &b, TensorShape shape_c)
 
template SimpleTensor< int32_t > gemmlowp< int32_t, uint8_t, uint8_t > (const SimpleTensor< uint8_t > &a, const SimpleTensor< uint8_t > &b, TensorShape shape_c)
 
template SimpleTensor< int32_t > gemmlowp< int32_t, uint8_t, int8_t > (const SimpleTensor< uint8_t > &a, const SimpleTensor< int8_t > &b, TensorShape shape_c)
 
template<typename T1 , typename T2 , typename T3 >
SimpleTensor< T1 > gemmlowp_matrix_multiply_core (const SimpleTensor< T2 > &a, const SimpleTensor< T3 > &b, TensorShape shape_c, int32_t a_offset, int32_t b_offset)
 
template<typename TIn , typename TOut >
SimpleTensor< uint8_t > gemmlowp_quantize_down_scale (const SimpleTensor< TIn > &in, int32_t result_offset, std::vector< int32_t > result_mult_int, std::vector< int32_t > result_shift)
 
template<typename T >
SimpleTensor< T > gemm_reshape_lhs_matrix (const SimpleTensor< T > &in, const TensorShape &output_shape, const GEMMLHSMatrixInfo &lhs_info)
 
template SimpleTensor< int > gemm_reshape_lhs_matrix (const SimpleTensor< int > &in, const TensorShape &output_shape, const GEMMLHSMatrixInfo &lhs_info)
 
template SimpleTensor< short > gemm_reshape_lhs_matrix (const SimpleTensor< short > &in, const TensorShape &output_shape, const GEMMLHSMatrixInfo &lhs_info)
 
template SimpleTensor< char > gemm_reshape_lhs_matrix (const SimpleTensor< char > &in, const TensorShape &output_shape, const GEMMLHSMatrixInfo &lhs_info)
 
template<typename T >
SimpleTensor< T > gemm_reshape_rhs_matrix (const SimpleTensor< T > &in, const TensorShape &output_shape, const GEMMRHSMatrixInfo &rhs_info)
 
template SimpleTensor< int > gemm_reshape_rhs_matrix (const SimpleTensor< int > &in, const TensorShape &output_shape, const GEMMRHSMatrixInfo &rhs_info)
 
template SimpleTensor< short > gemm_reshape_rhs_matrix (const SimpleTensor< short > &in, const TensorShape &output_shape, const GEMMRHSMatrixInfo &rhs_info)
 
template SimpleTensor< char > gemm_reshape_rhs_matrix (const SimpleTensor< char > &in, const TensorShape &output_shape, const GEMMRHSMatrixInfo &rhs_info)
 
template<typename T >
SimpleTensor< T > gemm_transpose_1xW (const SimpleTensor< T > &in)
 
template<typename T >
void im2col_nchw (const SimpleTensor< T > &src, SimpleTensor< T > &dst, const Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias, unsigned int num_groups)
 
template<typename T >
void im2col_nhwc (const SimpleTensor< T > &src, SimpleTensor< T > &dst, const Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias)
 
template<typename T >
void im2col (const SimpleTensor< T > &src, SimpleTensor< T > &dst, const Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias, unsigned int num_groups)
 
template void im2col (const SimpleTensor< uint8_t > &src, SimpleTensor< uint8_t > &dst, const Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias, unsigned int num_groups)
 
template void im2col (const SimpleTensor< half > &src, SimpleTensor< half > &dst, const Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias, unsigned int num_groups)
 
template void im2col (const SimpleTensor< float > &src, SimpleTensor< float > &dst, const Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias, unsigned int num_groups)
 
template<typename T >
SimpleTensor< T > instance_normalization (const SimpleTensor< T > &src, float gamma, float beta, float epsilon)
 
template SimpleTensor< float > instance_normalization (const SimpleTensor< float > &src, float gamma, float beta, float epsilon)
 
template SimpleTensor< halfinstance_normalization (const SimpleTensor< half > &src, float gamma, float beta, float epsilon)
 
template<typename T >
SimpleTensor< T > l2_normalize (const SimpleTensor< T > &src, unsigned int axis, float epsilon)
 
template SimpleTensor< float > l2_normalize (const SimpleTensor< float > &src, unsigned int axis, float epsilon)
 
template SimpleTensor< halfl2_normalize (const SimpleTensor< half > &src, unsigned int axis, float epsilon)
 
template<typename T >
logical_binary_op (arm_compute::LogicalOperation op, T src1, T src2)
 
template<typename T >
SimpleTensor< T > logical_or (const SimpleTensor< T > &src1, const SimpleTensor< T > &src2)
 
template<typename T >
SimpleTensor< T > logical_and (const SimpleTensor< T > &src1, const SimpleTensor< T > &src2)
 
template<typename T >
SimpleTensor< T > logical_not (const SimpleTensor< T > &src)
 
template SimpleTensor< uint8_t > logical_or (const SimpleTensor< uint8_t > &src1, const SimpleTensor< uint8_t > &src2)
 
template SimpleTensor< uint8_t > logical_and (const SimpleTensor< uint8_t > &src1, const SimpleTensor< uint8_t > &src2)
 
template SimpleTensor< uint8_t > logical_not (const SimpleTensor< uint8_t > &src1)
 
template<typename T >
SimpleTensor< T > max_unpooling_layer_internal (const SimpleTensor< T > &src, const PoolingLayerInfo &info, const QuantizationInfo &output_qinfo, SimpleTensor< uint32_t > &indices, TensorShape output_shape, DataLayout data_layout)
 
template<>
SimpleTensor< uint8_t > max_unpooling_layer< uint8_t > (const SimpleTensor< uint8_t > &src, const PoolingLayerInfo &info, const QuantizationInfo &output_qinfo, SimpleTensor< uint32_t > &indices, TensorShape output_shape, DataLayout data_layout)
 
template<typename T >
SimpleTensor< T > max_unpooling_layer (const SimpleTensor< T > &src, const PoolingLayerInfo &info, const QuantizationInfo &output_qinfo, SimpleTensor< uint32_t > &indices, TensorShape output_shape, DataLayout data_layout)
 
template SimpleTensor< float > max_unpooling_layer (const SimpleTensor< float > &src, const PoolingLayerInfo &info, const QuantizationInfo &output_qinfo, SimpleTensor< uint32_t > &indices, TensorShape output_shape, DataLayout data_layout)
 
template SimpleTensor< halfmax_unpooling_layer (const SimpleTensor< half > &src, const PoolingLayerInfo &info, const QuantizationInfo &output_qinfo, SimpleTensor< uint32_t > &indices, TensorShape output_shape, DataLayout data_layout)
 
template<typename T >
std::pair< float, float > mean_and_standard_deviation (const SimpleTensor< T > &in)
 
template std::pair< float, float > mean_and_standard_deviation (const SimpleTensor< uint8_t > &in)
 
template std::pair< float, float > mean_and_standard_deviation (const SimpleTensor< half > &in)
 
template std::pair< float, float > mean_and_standard_deviation (const SimpleTensor< float > &in)
 
template<typename T >
SimpleTensor< T > mean_std_normalization_layer (const SimpleTensor< T > &src, float epsilon)
 
template SimpleTensor< float > mean_std_normalization_layer (const SimpleTensor< float > &src, float epsilon)
 
template SimpleTensor< halfmean_std_normalization_layer (const SimpleTensor< half > &src, float epsilon)
 
template<typename T >
void compute_min_max (const SimpleTensor< T > &src, T &min, T &max)
 
template<typename T >
MinMaxLocationValues< T > min_max_location (const SimpleTensor< T > &src)
 
template MinMaxLocationValues< uint8_t > min_max_location (const SimpleTensor< uint8_t > &src)
 
template MinMaxLocationValues< int16_t > min_max_location (const SimpleTensor< int16_t > &src)
 
template MinMaxLocationValues< float > min_max_location (const SimpleTensor< float > &src)
 
template<typename T >
SimpleTensor< T > non_maxima_suppression (const SimpleTensor< T > &src, BorderMode border_mode, T constant_border_value)
 
template SimpleTensor< float > non_maxima_suppression (const SimpleTensor< float > &src, BorderMode border_mode, float constant_border_value)
 
template SimpleTensor< uint8_t > non_maxima_suppression (const SimpleTensor< uint8_t > &src, BorderMode border_mode, uint8_t constant_border_value)
 
SimpleTensor< int > non_max_suppression (const SimpleTensor< float > &bboxes, const SimpleTensor< float > &scores, SimpleTensor< int > &indices, unsigned int max_output_size, float score_threshold, float nms_threshold)
 
template<typename T >
SimpleTensor< T > normalization_layer (const SimpleTensor< T > &src, NormalizationLayerInfo info)
 
template SimpleTensor< float > normalization_layer (const SimpleTensor< float > &src, NormalizationLayerInfo info)
 
template SimpleTensor< halfnormalization_layer (const SimpleTensor< half > &src, NormalizationLayerInfo info)
 
template<typename T >
SimpleTensor< T > normalize_planar_yuv_layer (const SimpleTensor< T > &src, const SimpleTensor< T > &mean, const SimpleTensor< T > &std)
 
template<>
SimpleTensor< uint8_t > normalize_planar_yuv_layer< uint8_t > (const SimpleTensor< uint8_t > &src, const SimpleTensor< uint8_t > &mean, const SimpleTensor< uint8_t > &std)
 
template<>
SimpleTensor< int8_t > normalize_planar_yuv_layer< int8_t > (const SimpleTensor< int8_t > &src, const SimpleTensor< int8_t > &mean, const SimpleTensor< int8_t > &std)
 
template SimpleTensor< halfnormalize_planar_yuv_layer (const SimpleTensor< half > &src, const SimpleTensor< half > &mean, const SimpleTensor< half > &std)
 
template SimpleTensor< float > normalize_planar_yuv_layer (const SimpleTensor< float > &src, const SimpleTensor< float > &mean, const SimpleTensor< float > &std)
 
template<typename T >
SimpleTensor< T > pad_layer (const SimpleTensor< T > &src, const PaddingList &paddings, const PixelValue const_value=PixelValue(), const PaddingMode mode=PaddingMode::CONSTANT)
 Reference function to pad an ND tensor. More...
 
template SimpleTensor< float > pad_layer (const SimpleTensor< float > &src, const PaddingList &paddings, const PixelValue const_value=PixelValue(), const PaddingMode mode)
 
template SimpleTensor< halfpad_layer (const SimpleTensor< half > &src, const PaddingList &paddings, const PixelValue const_value=PixelValue(), const PaddingMode mode)
 
template SimpleTensor< uint8_t > pad_layer (const SimpleTensor< uint8_t > &src, const PaddingList &paddings, const PixelValue const_value=PixelValue(), const PaddingMode mode)
 
template SimpleTensor< int8_t > pad_layer (const SimpleTensor< int8_t > &src, const PaddingList &paddings, const PixelValue const_value=PixelValue(), const PaddingMode mode)
 
template SimpleTensor< uint16_t > pad_layer (const SimpleTensor< uint16_t > &src, const PaddingList &paddings, const PixelValue const_value=PixelValue(), const PaddingMode mode)
 
template SimpleTensor< int16_t > pad_layer (const SimpleTensor< int16_t > &src, const PaddingList &paddings, const PixelValue const_value=PixelValue(), const PaddingMode mode)
 
template SimpleTensor< uint32_t > pad_layer (const SimpleTensor< uint32_t > &src, const PaddingList &paddings, const PixelValue const_value=PixelValue(), const PaddingMode mode)
 
template SimpleTensor< int32_t > pad_layer (const SimpleTensor< int32_t > &src, const PaddingList &paddings, const PixelValue const_value=PixelValue(), const PaddingMode mode)
 
template<typename T >
SimpleTensor< T > permute (const SimpleTensor< T > &src, PermutationVector perm)
 
template SimpleTensor< int8_t > permute (const SimpleTensor< int8_t > &src, PermutationVector perm)
 
template SimpleTensor< uint8_t > permute (const SimpleTensor< uint8_t > &src, PermutationVector perm)
 
template SimpleTensor< int16_t > permute (const SimpleTensor< int16_t > &src, PermutationVector perm)
 
template SimpleTensor< uint16_t > permute (const SimpleTensor< uint16_t > &src, PermutationVector perm)
 
template SimpleTensor< uint32_t > permute (const SimpleTensor< uint32_t > &src, PermutationVector perm)
 
template SimpleTensor< float > permute (const SimpleTensor< float > &src, PermutationVector perm)
 
template SimpleTensor< halfpermute (const SimpleTensor< half > &src, PermutationVector perm)
 
template<typename T1 , typename T2 , typename T3 >
SimpleTensor< T3 > pixel_wise_multiplication (const SimpleTensor< T1 > &src1, const SimpleTensor< T2 > &src2, float scale, ConvertPolicy convert_policy, RoundingPolicy rounding_policy, DataType dt_out, const QuantizationInfo &qout)
 
template<>
SimpleTensor< uint8_t > pixel_wise_multiplication (const SimpleTensor< uint8_t > &src1, const SimpleTensor< uint8_t > &src2, float scale, ConvertPolicy convert_policy, RoundingPolicy rounding_policy, DataType dt_out, const QuantizationInfo &qout)
 
template<>
SimpleTensor< int16_t > pixel_wise_multiplication (const SimpleTensor< uint8_t > &src1, const SimpleTensor< uint8_t > &src2, float scale, ConvertPolicy convert_policy, RoundingPolicy rounding_policy, DataType dt_out, const QuantizationInfo &qout)
 
template<>
SimpleTensor< int8_t > pixel_wise_multiplication (const SimpleTensor< int8_t > &src1, const SimpleTensor< int8_t > &src2, float scale, ConvertPolicy convert_policy, RoundingPolicy rounding_policy, DataType dt_out, const QuantizationInfo &qout)
 
template<>
SimpleTensor< int16_t > pixel_wise_multiplication (const SimpleTensor< int16_t > &src1, const SimpleTensor< int16_t > &src2, float scale, ConvertPolicy convert_policy, RoundingPolicy rounding_policy, DataType dt_out, const QuantizationInfo &qout)
 
template SimpleTensor< int16_t > pixel_wise_multiplication (const SimpleTensor< uint8_t > &src1, const SimpleTensor< int16_t > &src2, float scale, ConvertPolicy convert_policy, RoundingPolicy rounding_policy, DataType dt_out, const QuantizationInfo &qout)
 
template SimpleTensor< int32_t > pixel_wise_multiplication (const SimpleTensor< int32_t > &src1, const SimpleTensor< int32_t > &src2, float scale, ConvertPolicy convert_policy, RoundingPolicy rounding_policy, DataType dt_out, const QuantizationInfo &qout)
 
template SimpleTensor< float > pixel_wise_multiplication (const SimpleTensor< float > &src1, const SimpleTensor< float > &src2, float scale, ConvertPolicy convert_policy, RoundingPolicy rounding_policy, DataType dt_out, const QuantizationInfo &qout)
 
template SimpleTensor< half_float::half > pixel_wise_multiplication (const SimpleTensor< half_float::half > &src1, const SimpleTensor< half_float::half > &src2, float scale, ConvertPolicy convert_policy, RoundingPolicy rounding_policy, DataType dt_out, const QuantizationInfo &qout)
 
template<typename T , typename ACC_T , typename std::enable_if< is_floating_point< T >::value, int >::type >
SimpleTensor< T > pooling_layer_internal (const SimpleTensor< T > &src, const PoolingLayerInfo &info, SimpleTensor< uint32_t > *indices, DataLayout data_layout)
 
template SimpleTensor< float > pooling_layer_internal< float > (const SimpleTensor< float > &src, const PoolingLayerInfo &info, SimpleTensor< uint32_t > *indices, DataLayout data_layout)
 
template SimpleTensor< halfpooling_layer_internal< half > (const SimpleTensor< half > &src, const PoolingLayerInfo &info, SimpleTensor< uint32_t > *indices, DataLayout data_layout)
 
template SimpleTensor< halfpooling_layer_internal< half, float > (const SimpleTensor< half > &src, const PoolingLayerInfo &info, SimpleTensor< uint32_t > *indices, DataLayout data_layout)
 
template<typename T >
SimpleTensor< T > pooling_layer (const SimpleTensor< T > &src, const PoolingLayerInfo &info, const QuantizationInfo &output_qinfo, SimpleTensor< uint32_t > *indices, DataLayout data_layout)
 
template<>
SimpleTensor< uint8_t > pooling_layer< uint8_t > (const SimpleTensor< uint8_t > &src, const PoolingLayerInfo &info, const QuantizationInfo &output_qinfo, SimpleTensor< uint32_t > *indices, DataLayout data_layout)
 
template<>
SimpleTensor< int8_t > pooling_layer< int8_t > (const SimpleTensor< int8_t > &src, const PoolingLayerInfo &info, const QuantizationInfo &output_qinfo, SimpleTensor< uint32_t > *indices, DataLayout data_layout)
 
template<>
SimpleTensor< halfpooling_layer (const SimpleTensor< half > &src, const PoolingLayerInfo &info, const QuantizationInfo &output_qinfo, SimpleTensor< uint32_t > *indices, DataLayout data_layout)
 
template SimpleTensor< float > pooling_layer (const SimpleTensor< float > &src, const PoolingLayerInfo &info, const QuantizationInfo &output_qinfo, SimpleTensor< uint32_t > *indices, DataLayout data_layout)
 
template<typename T >
SimpleTensor< T > prior_box_layer (const SimpleTensor< T > &src1, const SimpleTensor< T > &src2, const PriorBoxLayerInfo &info, const TensorShape &output_shape)
 
template SimpleTensor< float > prior_box_layer (const SimpleTensor< float > &src1, const SimpleTensor< float > &src2, const PriorBoxLayerInfo &info, const TensorShape &output_shape)
 
SimpleTensor< int16_t > qlstm_layer_normalization (const SimpleTensor< int16_t > &src, const SimpleTensor< int16_t > &weight, const SimpleTensor< int32_t > &bias)
 
template<typename Tin , typename Tout >
SimpleTensor< Tout > quantization_layer (const SimpleTensor< Tin > &src, DataType output_data_type, const QuantizationInfo &quantization_info)
 
template<>
SimpleTensor< uint8_t > quantization_layer (const SimpleTensor< uint8_t > &src, DataType output_data_type, const QuantizationInfo &quantization_info)
 
template<>
SimpleTensor< int8_t > quantization_layer (const SimpleTensor< uint8_t > &src, DataType output_data_type, const QuantizationInfo &quantization_info)
 
template<>
SimpleTensor< uint8_t > quantization_layer (const SimpleTensor< int8_t > &src, DataType output_data_type, const QuantizationInfo &quantization_info)
 
template<>
SimpleTensor< int8_t > quantization_layer (const SimpleTensor< int8_t > &src, DataType output_data_type, const QuantizationInfo &quantization_info)
 
template<>
SimpleTensor< uint16_t > quantization_layer (const SimpleTensor< uint8_t > &src, DataType output_data_type, const QuantizationInfo &quantization_info)
 
template SimpleTensor< int8_t > quantization_layer (const SimpleTensor< half > &src, DataType output_data_type, const QuantizationInfo &quantization_info)
 
template SimpleTensor< int8_t > quantization_layer (const SimpleTensor< float > &src, DataType output_data_type, const QuantizationInfo &quantization_info)
 
template<typename T >
SimpleTensor< T > range (SimpleTensor< T > &dst, float start, const size_t num_of_elements, float step)
 
template<>
SimpleTensor< uint8_t > range (SimpleTensor< uint8_t > &dst, float start, const size_t num_of_elements, float step)
 
template SimpleTensor< float > range (SimpleTensor< float > &dst, float start, const size_t num_of_elements, float step)
 
template SimpleTensor< halfrange (SimpleTensor< half > &dst, float start, const size_t num_of_elements, float step)
 
template SimpleTensor< int8_t > range (SimpleTensor< int8_t > &dst, float start, const size_t num_of_elements, float step)
 
template SimpleTensor< uint16_t > range (SimpleTensor< uint16_t > &dst, float start, const size_t num_of_elements, float step)
 
template SimpleTensor< int16_t > range (SimpleTensor< int16_t > &dst, float start, const size_t num_of_elements, float step)
 
template<typename T , typename OT >
SimpleTensor< OT > compute_reduction_operation (const SimpleTensor< T > &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op)
 
template<typename T , typename OT >
SimpleTensor< OT > reduction_operation (const SimpleTensor< T > &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op, QuantizationInfo quantization_info_output)
 
template<>
SimpleTensor< uint8_t > reduction_operation (const SimpleTensor< uint8_t > &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op, QuantizationInfo quantization_info_output)
 
template<>
SimpleTensor< int8_t > reduction_operation (const SimpleTensor< int8_t > &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op, QuantizationInfo quantization_info_output)
 
template SimpleTensor< float > reduction_operation (const SimpleTensor< float > &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op, QuantizationInfo quantization_info_output=QuantizationInfo())
 
template SimpleTensor< halfreduction_operation (const SimpleTensor< half > &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op, QuantizationInfo quantization_info_output=QuantizationInfo())
 
template SimpleTensor< int32_t > reduction_operation (const SimpleTensor< int32_t > &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op, QuantizationInfo quantization_info_output=QuantizationInfo())
 
template<typename T >
SimpleTensor< T > remap (const SimpleTensor< T > &in, SimpleTensor< float > &map_x, SimpleTensor< float > &map_y, SimpleTensor< T > &valid_mask, InterpolationPolicy policy, BorderMode border_mode, T constant_border_value)
 
template SimpleTensor< uint8_t > remap (const SimpleTensor< uint8_t > &src, SimpleTensor< float > &map_x, SimpleTensor< float > &map_y, SimpleTensor< uint8_t > &valid_mask, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value)
 
template SimpleTensor< halfremap (const SimpleTensor< half > &src, SimpleTensor< float > &map_x, SimpleTensor< float > &map_y, SimpleTensor< half > &valid_mask, InterpolationPolicy policy, BorderMode border_mode, half constant_border_value)
 
template<typename T >
SimpleTensor< T > reorg_layer (const SimpleTensor< T > &src, int32_t stride)
 
template SimpleTensor< int32_t > reorg_layer (const SimpleTensor< int32_t > &src, int32_t stride)
 
template SimpleTensor< int16_t > reorg_layer (const SimpleTensor< int16_t > &src, int32_t stride)
 
template SimpleTensor< int8_t > reorg_layer (const SimpleTensor< int8_t > &src, int32_t stride)
 
template<typename T >
SimpleTensor< T > reshape_layer (const SimpleTensor< T > &src, const TensorShape &output_shape)
 [ReshapeLayer] More...
 
template SimpleTensor< uint8_t > reshape_layer (const SimpleTensor< uint8_t > &src, const TensorShape &output_shape)
 
template SimpleTensor< int8_t > reshape_layer (const SimpleTensor< int8_t > &src, const TensorShape &output_shape)
 
template SimpleTensor< uint16_t > reshape_layer (const SimpleTensor< uint16_t > &src, const TensorShape &output_shape)
 
template SimpleTensor< int16_t > reshape_layer (const SimpleTensor< int16_t > &src, const TensorShape &output_shape)
 
template SimpleTensor< uint32_t > reshape_layer (const SimpleTensor< uint32_t > &src, const TensorShape &output_shape)
 
template SimpleTensor< int32_t > reshape_layer (const SimpleTensor< int32_t > &src, const TensorShape &output_shape)
 
template SimpleTensor< halfreshape_layer (const SimpleTensor< half > &src, const TensorShape &output_shape)
 
template SimpleTensor< float > reshape_layer (const SimpleTensor< float > &src, const TensorShape &output_shape)
 
template<typename T >
SimpleTensor< T > reverse (const SimpleTensor< T > &src, const SimpleTensor< uint32_t > &axis)
 
template SimpleTensor< uint8_t > reverse (const SimpleTensor< uint8_t > &src, const SimpleTensor< uint32_t > &axis)
 
template SimpleTensor< halfreverse (const SimpleTensor< half > &src, const SimpleTensor< uint32_t > &axis)
 
template SimpleTensor< float > reverse (const SimpleTensor< float > &src, const SimpleTensor< uint32_t > &axis)
 
template<>
SimpleTensor< float > roi_align_layer (const SimpleTensor< float > &src, const SimpleTensor< float > &rois, const ROIPoolingLayerInfo &pool_info, const QuantizationInfo &output_qinfo)
 
template<>
SimpleTensor< halfroi_align_layer (const SimpleTensor< half > &src, const SimpleTensor< half > &rois, const ROIPoolingLayerInfo &pool_info, const QuantizationInfo &output_qinfo)
 
template<>
SimpleTensor< uint8_t > roi_align_layer (const SimpleTensor< uint8_t > &src, const SimpleTensor< uint16_t > &rois, const ROIPoolingLayerInfo &pool_info, const QuantizationInfo &output_qinfo)
 
template<>
SimpleTensor< int8_t > roi_align_layer (const SimpleTensor< int8_t > &src, const SimpleTensor< uint16_t > &rois, const ROIPoolingLayerInfo &pool_info, const QuantizationInfo &output_qinfo)
 
template<typename T , typename TRois >
SimpleTensor< T > roi_align_layer (const SimpleTensor< T > &src, const SimpleTensor< TRois > &rois, const ROIPoolingLayerInfo &pool_info, const QuantizationInfo &output_qinfo)
 
template<>
SimpleTensor< float > roi_pool_layer (const SimpleTensor< float > &src, const SimpleTensor< uint16_t > &rois, const ROIPoolingLayerInfo &pool_info, const QuantizationInfo &output_qinfo)
 
template<>
SimpleTensor< uint8_t > roi_pool_layer (const SimpleTensor< uint8_t > &src, const SimpleTensor< uint16_t > &rois, const ROIPoolingLayerInfo &pool_info, const QuantizationInfo &output_qinfo)
 
template<typename T >
SimpleTensor< T > roi_pool_layer (const SimpleTensor< T > &src, const SimpleTensor< uint16_t > &rois, const ROIPoolingLayerInfo &pool_info, const QuantizationInfo &output_qinfo)
 
template<typename T >
SimpleTensor< T > scale_core (const SimpleTensor< T > &in, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, T constant_border_value, SamplingPolicy sampling_policy, bool ceil_policy_scale, bool align_corners)
 
template<typename T >
SimpleTensor< T > scale (const SimpleTensor< T > &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, T constant_border_value, SamplingPolicy sampling_policy, bool ceil_policy_scale, bool align_corners)
 
template<>
SimpleTensor< uint8_t > scale (const SimpleTensor< uint8_t > &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value, SamplingPolicy sampling_policy, bool ceil_policy_scale, bool align_corners)
 
template<>
SimpleTensor< int8_t > scale (const SimpleTensor< int8_t > &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, int8_t constant_border_value, SamplingPolicy sampling_policy, bool ceil_policy_scale, bool align_corners)
 
template SimpleTensor< int16_t > scale (const SimpleTensor< int16_t > &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, int16_t constant_border_value, SamplingPolicy sampling_policy, bool ceil_policy_scale, bool align_corners)
 
template SimpleTensor< halfscale (const SimpleTensor< half > &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, half constant_border_value, SamplingPolicy sampling_policy, bool ceil_policy_scale, bool align_corners)
 
template SimpleTensor< float > scale (const SimpleTensor< float > &src, float scale_x, float scale_y, InterpolationPolicy policy, BorderMode border_mode, float constant_border_value, SamplingPolicy sampling_policy, bool ceil_policy_scale, bool align_corners)
 
template<typename T >
SimpleTensor< T > select (const SimpleTensor< uint8_t > &c, const SimpleTensor< T > &x, const SimpleTensor< T > &y)
 
template SimpleTensor< uint8_t > select (const SimpleTensor< uint8_t > &c, const SimpleTensor< uint8_t > &x, const SimpleTensor< uint8_t > &y)
 
template SimpleTensor< halfselect (const SimpleTensor< uint8_t > &c, const SimpleTensor< half > &x, const SimpleTensor< half > &y)
 
template SimpleTensor< float > select (const SimpleTensor< uint8_t > &c, const SimpleTensor< float > &x, const SimpleTensor< float > &y)
 
template<typename T >
SimpleTensor< T > slice (const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)
 
template SimpleTensor< float > slice (const SimpleTensor< float > &src, Coordinates starts, Coordinates ends)
 
template SimpleTensor< half_float::half > slice (const SimpleTensor< half_float::half > &src, Coordinates starts, Coordinates ends)
 
template<typename T >
SimpleTensor< T > strided_slice (const SimpleTensor< T > &src, Coordinates starts, Coordinates ends, BiStrides strides, int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask)
 
template SimpleTensor< float > strided_slice (const SimpleTensor< float > &src, Coordinates starts, Coordinates ends, BiStrides strides, int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask)
 
template SimpleTensor< half_float::half > strided_slice (const SimpleTensor< half_float::half > &src, Coordinates starts, Coordinates ends, BiStrides strides, int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask)
 
template<typename T , typename std::enable_if< is_floating_point< T >::value, int >::type >
SimpleTensor< T > softmax_layer_generic (const SimpleTensor< T > &src, float beta, int32_t axis, bool is_log)
 
template SimpleTensor< float > softmax_layer_generic (const SimpleTensor< float > &src, float beta, int32_t axis, bool is_log)
 
template SimpleTensor< halfsoftmax_layer_generic (const SimpleTensor< half > &src, float beta, int32_t axis, bool is_log)
 
template<typename T , typename std::enable_if< is_floating_point< T >::value, int >::type >
SimpleTensor< T > softmax_layer (const SimpleTensor< T > &src, float beta, int32_t axis, bool is_log)
 
template SimpleTensor< float > softmax_layer (const SimpleTensor< float > &src, float beta, int32_t axis, bool is_log)
 
template SimpleTensor< halfsoftmax_layer (const SimpleTensor< half > &src, float beta, int32_t axis, bool is_log)
 
template SimpleTensor< uint8_t > softmax_layer (const SimpleTensor< uint8_t > &src, float beta, int32_t axis, bool is_log)
 
template SimpleTensor< int8_t > softmax_layer (const SimpleTensor< int8_t > &src, float beta, int32_t axis, bool is_log)
 
template<typename T >
SimpleTensor< T > space_to_batch (const SimpleTensor< T > &src, const SimpleTensor< int32_t > &block_shape, const SimpleTensor< int32_t > &paddings, const TensorShape &dst_shape)
 
template SimpleTensor< float > space_to_batch (const SimpleTensor< float > &src, const SimpleTensor< int32_t > &block_shape, const SimpleTensor< int32_t > &paddings, const TensorShape &dst_shape)
 
template SimpleTensor< halfspace_to_batch (const SimpleTensor< half > &src, const SimpleTensor< int32_t > &block_shape, const SimpleTensor< int32_t > &paddings, const TensorShape &dst_shape)
 
template SimpleTensor< uint8_t > space_to_batch (const SimpleTensor< uint8_t > &src, const SimpleTensor< int32_t > &block_shape, const SimpleTensor< int32_t > &paddings, const TensorShape &dst_shape)
 
template<typename T >
SimpleTensor< T > space_to_depth (const SimpleTensor< T > &src, const TensorShape &dst_shape, const int block_shape)
 
template SimpleTensor< float > space_to_depth (const SimpleTensor< float > &src, const TensorShape &dst_shape, const int block_shape)
 
template SimpleTensor< halfspace_to_depth (const SimpleTensor< half > &src, const TensorShape &dst_shape, const int block_shape)
 
template<typename T >
SimpleTensor< T > stack_layer (const std::vector< SimpleTensor< T >> &in, const TensorShape &output_shape, DataType data_type, unsigned int axis)
 
template SimpleTensor< int > stack_layer (const std::vector< SimpleTensor< int >> &in, const TensorShape &output_shape, DataType data_type, unsigned int axis)
 
template SimpleTensor< short > stack_layer (const std::vector< SimpleTensor< short >> &in, const TensorShape &output_shape, DataType data_type, unsigned int axis)
 
template SimpleTensor< char > stack_layer (const std::vector< SimpleTensor< char >> &in, const TensorShape &output_shape, DataType data_type, unsigned int axis)
 
template<typename T >
SimpleTensor< T > table_lookup (const SimpleTensor< T > &src, const std::map< T, T > &rawlut)
 
template SimpleTensor< uint8_t > table_lookup (const SimpleTensor< uint8_t > &src, const std::map< uint8_t, uint8_t > &rawlut)
 
template SimpleTensor< int16_t > table_lookup (const SimpleTensor< int16_t > &src, const std::map< int16_t, int16_t > &rawlut)
 
template<typename T >
SimpleTensor< T > tile (const SimpleTensor< T > &src, const Multiples &multiples)
 
template SimpleTensor< uint8_t > tile (const SimpleTensor< uint8_t > &src, const Multiples &multiples)
 
template SimpleTensor< int8_t > tile (const SimpleTensor< int8_t > &src, const Multiples &multiples)
 
template SimpleTensor< uint16_t > tile (const SimpleTensor< uint16_t > &src, const Multiples &multiples)
 
template SimpleTensor< int16_t > tile (const SimpleTensor< int16_t > &src, const Multiples &multiples)
 
template SimpleTensor< uint32_t > tile (const SimpleTensor< uint32_t > &src, const Multiples &multiples)
 
template SimpleTensor< int32_t > tile (const SimpleTensor< int32_t > &src, const Multiples &multiples)
 
template SimpleTensor< halftile (const SimpleTensor< half > &src, const Multiples &multiples)
 
template SimpleTensor< float > tile (const SimpleTensor< float > &src, const Multiples &multiples)
 
template<typename T >
SimpleTensor< T > transpose (const SimpleTensor< T > &src)
 
template SimpleTensor< uint8_t > transpose (const SimpleTensor< uint8_t > &src)
 
template SimpleTensor< uint16_t > transpose (const SimpleTensor< uint16_t > &src)
 
template SimpleTensor< uint32_t > transpose (const SimpleTensor< uint32_t > &src)
 
template SimpleTensor< halftranspose (const SimpleTensor< half > &src)
 
template SimpleTensor< float > transpose (const SimpleTensor< float > &src)
 
template<typename T >
std::vector< SimpleTensor< T > > unstack (const SimpleTensor< T > &input_tensor, std::vector< SimpleTensor< T >> &output_tensors, int axis)
 
template std::vector< SimpleTensor< float > > unstack (const SimpleTensor< float > &input_tensor, std::vector< SimpleTensor< float >> &output_tensors, int axis)
 
template std::vector< SimpleTensor< half > > unstack (const SimpleTensor< half > &input_tensor, std::vector< SimpleTensor< half >> &output_tensors, int axis)
 
template std::vector< SimpleTensor< uint8_t > > unstack (const SimpleTensor< uint8_t > &input_tensor, std::vector< SimpleTensor< uint8_t >> &output_tensors, int axis)
 
template<typename T >
SimpleTensor< T > weights_reshape (const SimpleTensor< T > &src, const SimpleTensor< T > &biases, const TensorShape &dst_shape, const unsigned int num_groups)
 
template SimpleTensor< float > weights_reshape (const SimpleTensor< float > &src, const SimpleTensor< float > &biases, const TensorShape &dst_shape, const unsigned int num_groups)
 
template SimpleTensor< halfweights_reshape (const SimpleTensor< half > &src, const SimpleTensor< half > &biases, const TensorShape &dst_shape, const unsigned int num_groups)
 
template SimpleTensor< uint8_t > weights_reshape (const SimpleTensor< uint8_t > &src, const SimpleTensor< uint8_t > &biases, const TensorShape &dst_shape, const unsigned int num_groups)
 
template<typename T >
SimpleTensor< T > winograd_input_transform (const SimpleTensor< T > &in, const TensorShape &output_shape, const WinogradInfo &winograd_info)
 
template<typename T >
SimpleTensor< T > winograd_filter_transform (const SimpleTensor< T > &in, const TensorShape &output_shape, const WinogradInfo &winograd_info)
 
template<typename T >
SimpleTensor< T > winograd_output_transform (const SimpleTensor< T > &in, const SimpleTensor< T > &b, const TensorShape &output_shape, const WinogradInfo &winograd_info)
 
template SimpleTensor< float > winograd_filter_transform (const SimpleTensor< float > &in, const TensorShape &output_shape, const WinogradInfo &winograd_info)
 
template SimpleTensor< float > winograd_input_transform (const SimpleTensor< float > &in, const TensorShape &output_shape, const WinogradInfo &winograd_info)
 
template SimpleTensor< float > winograd_output_transform (const SimpleTensor< float > &in, const SimpleTensor< float > &b, const TensorShape &output_shape, const WinogradInfo &winograd_info)
 
template SimpleTensor< halfwinograd_filter_transform (const SimpleTensor< half > &in, const TensorShape &output_shape, const WinogradInfo &winograd_info)
 
template SimpleTensor< halfwinograd_input_transform (const SimpleTensor< half > &in, const TensorShape &output_shape, const WinogradInfo &winograd_info)
 
template SimpleTensor< halfwinograd_output_transform (const SimpleTensor< half > &in, const SimpleTensor< half > &b, const TensorShape &output_shape, const WinogradInfo &winograd_info)
 

Enumeration Type Documentation

◆ ArithmeticOperation

enum ArithmeticOperation
strong

Arithmetic operation types.

Enumerator
ADD 
SUB 

Definition at line 39 of file ArithmeticOperations.h.

40 {
41  ADD,
42  SUB
43 };
#define SUB(x, y)
#define ADD(x, y)

◆ FFTDirection

enum FFTDirection
strong
Enumerator
Forward 
Inverse 

Definition at line 38 of file DFT.h.

◆ WinogradTransformType

enum WinogradTransformType
strong

Winograd transform type.

Enumerator
INPUT 

Winograd input transform.

FILTER 

Winograd filter transform.

OUTPUT 

Winograd output transform.

Definition at line 40 of file Winograd.h.

41 {
42  INPUT, /**< Winograd input transform */
43  FILTER, /**< Winograd filter transform */
44  OUTPUT /**< Winograd output transform */
45 };

Function Documentation

◆ absolute_difference() [1/4]

SimpleTensor< T > absolute_difference ( const SimpleTensor< T > &  src1,
const SimpleTensor< T > &  src2,
DataType  dst_data_type 
)

Definition at line 38 of file AbsoluteDifference.cpp.

References SimpleTensor< T >::num_elements(), arm_compute::test::saturate_cast(), and SimpleTensor< T >::shape().

39 {
40  SimpleTensor<T> result(src1.shape(), dst_data_type);
41 
42  using intermediate_type = typename common_promoted_signed_type<T>::intermediate_type;
43 #if defined(_OPENMP)
44  #pragma omp parallel for
45 #endif /* _OPENMP */
46  for(int i = 0; i < src1.num_elements(); ++i)
47  {
48  intermediate_type val = std::abs(static_cast<intermediate_type>(src1[i]) - static_cast<intermediate_type>(src2[i]));
49  result[i] = saturate_cast<T>(val);
50  }
51 
52  return result;
53 }
T saturate_cast(T val)
Saturate a value of type T against the numeric limits of type U.
Definition: Utils.h:312

◆ absolute_difference() [2/4]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::absolute_difference ( const SimpleTensor< uint8_t > &  src1,
const SimpleTensor< uint8_t > &  src2,
DataType  dst_data_type 
)

◆ absolute_difference() [3/4]

template SimpleTensor<int16_t> arm_compute::test::validation::reference::absolute_difference ( const SimpleTensor< int16_t > &  src1,
const SimpleTensor< int16_t > &  src2,
DataType  dst_data_type 
)

◆ absolute_difference() [4/4]

template SimpleTensor<int8_t> arm_compute::test::validation::reference::absolute_difference ( const SimpleTensor< int8_t > &  src1,
const SimpleTensor< int8_t > &  src2,
DataType  dst_data_type 
)

◆ accumulate() [1/2]

SimpleTensor< T2 > accumulate ( const SimpleTensor< T1 > &  src,
DataType  output_data_type 
)

Definition at line 38 of file Accumulate.cpp.

References arm_compute::test::validation::dst, arm_compute::test::library, SimpleTensor< T >::num_elements(), arm_compute::test::saturate_cast(), and SimpleTensor< T >::shape().

Referenced by accumulate_squared(), Dimensions< size_t >::collapse(), arm_compute::detail::convolve_3x3(), arm_compute::helpers::fft::digit_reverse_indices(), InstrumentsStats::InstrumentsStats(), arm_compute::test::join(), mean_and_standard_deviation(), arm_compute::scale_helpers::pixel_area_c1u8_clamp(), SimpleTensor< uint8_t >::size(), OpenCLMemoryUsage::test_measurements(), TensorShape::total_size(), TensorShape::total_size_lower(), and TensorShape::total_size_upper().

39 {
40  SimpleTensor<T2> dst{ src.shape(), output_data_type };
41 
42  library->fill_tensor_uniform(dst, 1, static_cast<T2>(0), static_cast<T2>(std::numeric_limits<T1>::max()));
43 
44  using intermediate_type = typename common_promoted_signed_type<T1, T2>::intermediate_type;
45 #if defined(_OPENMP)
46  #pragma omp parallel for
47 #endif /* _OPENMP */
48  for(int i = 0; i < src.num_elements(); ++i)
49  {
50  intermediate_type val = static_cast<intermediate_type>(src[i]) + static_cast<intermediate_type>(dst[i]);
51  dst[i] = saturate_cast<T2>(val);
52  }
53 
54  return dst;
55 }
SimpleTensor< float > src
Definition: DFT.cpp:155
std::unique_ptr< AssetsLibrary > library
Definition: main.cpp:76
T saturate_cast(T val)
Saturate a value of type T against the numeric limits of type U.
Definition: Utils.h:312

◆ accumulate() [2/2]

template SimpleTensor<int16_t> arm_compute::test::validation::reference::accumulate ( const SimpleTensor< uint8_t > &  src,
DataType  output_data_type 
)

◆ accumulate_squared() [1/2]

SimpleTensor< T2 > accumulate_squared ( const SimpleTensor< T1 > &  src,
uint32_t  shift,
DataType  output_data_type 
)

Definition at line 80 of file Accumulate.cpp.

References accumulate(), accumulate_weighted(), ARM_COMPUTE_ERROR_ON_MSG, arm_compute::test::validation::dst, arm_compute::test::library, SimpleTensor< T >::num_elements(), arm_compute::test::saturate_cast(), SimpleTensor< T >::shape(), and arm_compute::test::validation::src.

81 {
82  ARM_COMPUTE_ERROR_ON_MSG(shift > 15, "Shift in accumulate_squared must be within the range [0, 15]");
83 
84  SimpleTensor<T2> dst{ src.shape(), output_data_type };
85 
86  library->fill_tensor_uniform(dst, 1, static_cast<T2>(0), static_cast<T2>(std::numeric_limits<T1>::max()));
87 
88  using intermediate_type = typename common_promoted_signed_type<T1, T2>::intermediate_type;
89  intermediate_type denom = 1 << shift;
90 #if defined(_OPENMP)
91  #pragma omp parallel for
92 #endif /* _OPENMP */
93  for(int i = 0; i < src.num_elements(); ++i)
94  {
95  intermediate_type val = static_cast<intermediate_type>(dst[i]) + (static_cast<intermediate_type>(src[i]) * static_cast<intermediate_type>(src[i]) / denom);
96  dst[i] = saturate_cast<T2>(val);
97  }
98 
99  return dst;
100 }
SimpleTensor< float > src
Definition: DFT.cpp:155
std::unique_ptr< AssetsLibrary > library
Definition: main.cpp:76
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Definition: Error.h:456
T saturate_cast(T val)
Saturate a value of type T against the numeric limits of type U.
Definition: Utils.h:312

◆ accumulate_squared() [2/2]

template SimpleTensor<int16_t> arm_compute::test::validation::reference::accumulate_squared ( const SimpleTensor< uint8_t > &  src,
uint32_t  shift,
DataType  output_data_type 
)

◆ accumulate_weighted() [1/2]

SimpleTensor< T2 > accumulate_weighted ( const SimpleTensor< T1 > &  src,
float  alpha,
DataType  output_data_type 
)

Definition at line 58 of file Accumulate.cpp.

References ARM_COMPUTE_ERROR_ON_MSG, arm_compute::test::validation::dst, arm_compute::test::library, SimpleTensor< T >::num_elements(), and SimpleTensor< T >::shape().

Referenced by accumulate_squared().

59 {
60  ARM_COMPUTE_ERROR_ON_MSG(alpha < 0.f || alpha > 1.f, "Weight (alpha) specified in accumulate_weighted must be within the range [0, 1]");
61 
62  SimpleTensor<T2> dst{ src.shape(), output_data_type };
63 
64  library->fill_tensor_uniform(dst, 1, static_cast<T2>(0), static_cast<T2>(std::numeric_limits<T1>::max()));
65 
66  using intermediate_type = typename common_promoted_signed_type<T1, T2>::intermediate_type;
67 #if defined(_OPENMP)
68  #pragma omp parallel for
69 #endif /* _OPENMP */
70  for(int i = 0; i < src.num_elements(); ++i)
71  {
72  double val = (1. - static_cast<double>(alpha)) * static_cast<intermediate_type>(dst[i]) + static_cast<double>(alpha) * static_cast<intermediate_type>(src[i]);
73  dst[i] = static_cast<T2>(val);
74  }
75 
76  return dst;
77 }
SimpleTensor< float > src
Definition: DFT.cpp:155
std::unique_ptr< AssetsLibrary > library
Definition: main.cpp:76
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Definition: Error.h:456

◆ accumulate_weighted() [2/2]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::accumulate_weighted ( const SimpleTensor< uint8_t > &  src,
float  alpha,
DataType  output_data_type 
)

◆ activate_float()

T arm_compute::test::validation::reference::activate_float ( x,
a,
b,
ActivationLayerInfo::ActivationFunction  activation 
)
inline

Definition at line 39 of file ActivationLayer.h.

References ActivationLayerInfo::ABS, activation_layer(), ARM_COMPUTE_ERROR, arm_compute::test::validation::b, ActivationLayerInfo::BOUNDED_RELU, ActivationLayerInfo::ELU, ActivationLayerInfo::HARD_SWISH, ActivationLayerInfo::IDENTITY, arm_compute::test::validation::info, ActivationLayerInfo::LEAKY_RELU, ActivationLayerInfo::LINEAR, ActivationLayerInfo::LOGISTIC, ActivationLayerInfo::LU_BOUNDED_RELU, ActivationLayerInfo::RELU, ActivationLayerInfo::SOFT_RELU, ActivationLayerInfo::SQRT, ActivationLayerInfo::SQUARE, arm_compute::test::validation::src, and ActivationLayerInfo::TANH.

40 {
41  T ret;
42 
43  switch(activation)
44  {
45  case ActivationLayerInfo::ActivationFunction::ABS:
46  ret = std::abs(x);
47  break;
48  case ActivationLayerInfo::ActivationFunction::LINEAR:
49  ret = a * x + b;
50  break;
51  case ActivationLayerInfo::ActivationFunction::LOGISTIC:
52  ret = static_cast<T>(1) / (static_cast<T>(1) + std::exp(-x));
53  break;
54  case ActivationLayerInfo::ActivationFunction::RELU:
55  ret = std::max<T>(static_cast<T>(0), x);
56  break;
57  case ActivationLayerInfo::ActivationFunction::BOUNDED_RELU:
58  ret = std::min<T>(a, std::max(static_cast<T>(0), x));
59  break;
60  case ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU:
61  ret = std::min<T>(a, std::max<T>(b, x));
62  break;
63  case ActivationLayerInfo::ActivationFunction::LEAKY_RELU:
64  ret = (x > 0) ? x : a * x;
65  break;
66  case ActivationLayerInfo::ActivationFunction::SOFT_RELU:
67  ret = std::log(static_cast<T>(1) + std::exp(x));
68  break;
69  case ActivationLayerInfo::ActivationFunction::ELU:
70  ret = (x > 0) ? x : a * (std::exp(x) - static_cast<T>(1));
71  break;
72  case ActivationLayerInfo::ActivationFunction::SQRT:
73  ret = std::sqrt(x);
74  break;
75  case ActivationLayerInfo::ActivationFunction::SQUARE:
76  ret = x * x;
77  break;
78  case ActivationLayerInfo::ActivationFunction::TANH:
79  ret = a * std::tanh(b * x);
80  break;
81  case ActivationLayerInfo::ActivationFunction::IDENTITY:
82  ret = x;
83  break;
84  case ActivationLayerInfo::ActivationFunction::HARD_SWISH:
85  ret = x * ((std::min(std::max(static_cast<T>(x + 3), static_cast<T>(0.0f)), static_cast<T>(6.0f))) * 0.166666667f);
86  break;
87  default:
88  ARM_COMPUTE_ERROR("Unsupported activation function");
89  break;
90  }
91 
92  return ret;
93 }
SimpleTensor< float > b
Definition: DFT.cpp:157
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352

◆ activation_layer() [1/4]

SimpleTensor< T > activation_layer ( const SimpleTensor< T > &  src,
ActivationLayerInfo  info,
const QuantizationInfo oq_info 
)

Definition at line 38 of file ActivationLayer.cpp.

References ActivationLayerInfo::a(), ActivationLayerInfo::activation(), ARM_COMPUTE_UNUSED, arm_compute::test::validation::b, ActivationLayerInfo::b(), SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, SimpleTensor< T >::num_elements(), and SimpleTensor< T >::shape().

Referenced by activate_float(), activation_layer< int16_t >(), and batch_normalization_layer().

39 {
40  ARM_COMPUTE_UNUSED(oq_info);
41 
42  // Create reference
43  SimpleTensor<T> dst{ src.shape(), src.data_type(), 1 };
44 
45  // Compute reference
46  const T a(info.a());
47  const T b(info.b());
48 #if defined(_OPENMP)
49  #pragma omp parallel for
50 #endif /* _OPENMP */
51  for(int i = 0; i < src.num_elements(); ++i)
52  {
53  dst[i] = activate_float<T>(src[i], a, b, info.activation());
54  }
55 
56  return dst;
57 }
SimpleTensor< float > b
Definition: DFT.cpp:157
SimpleTensor< float > src
Definition: DFT.cpp:155
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:152
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)

◆ activation_layer() [2/4]

template SimpleTensor<int32_t> arm_compute::test::validation::reference::activation_layer ( const SimpleTensor< int32_t > &  src,
ActivationLayerInfo  info,
const QuantizationInfo oq_info 
)

◆ activation_layer() [3/4]

template SimpleTensor<float> arm_compute::test::validation::reference::activation_layer ( const SimpleTensor< float > &  src,
ActivationLayerInfo  info,
const QuantizationInfo oq_info 
)

◆ activation_layer() [4/4]

template SimpleTensor<half> arm_compute::test::validation::reference::activation_layer ( const SimpleTensor< half > &  src,
ActivationLayerInfo  info,
const QuantizationInfo oq_info 
)

◆ activation_layer< int16_t >()

SimpleTensor<int16_t> arm_compute::test::validation::reference::activation_layer< int16_t > ( const SimpleTensor< int16_t > &  src,
ActivationLayerInfo  info,
const QuantizationInfo oq_info 
)

Definition at line 82 of file ActivationLayer.cpp.

References activation_layer(), arm_compute::test::validation::convert_from_symmetric(), arm_compute::test::validation::dst, QuantizationInfo::empty(), arm_compute::test::validation::info, and SimpleTensor< T >::quantization_info().

83 {
84  const QuantizationInfo dst_qinfo = oq_info.empty() ? src.quantization_info() : oq_info;
85 
86  SimpleTensor<float> src_tmp = convert_from_symmetric(src);
87  SimpleTensor<float> dst_tmp = activation_layer<float>(src_tmp, info);
88  SimpleTensor<int16_t> dst = convert_to_symmetric<int16_t>(dst_tmp, dst_qinfo);
89  return dst;
90 }
SimpleTensor< float > src
Definition: DFT.cpp:155
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
SimpleTensor< float > convert_from_symmetric(const SimpleTensor< int16_t > &src)
Definition: Helpers.cpp:147

◆ activation_layer< int8_t >()

SimpleTensor<int8_t> arm_compute::test::validation::reference::activation_layer< int8_t > ( const SimpleTensor< int8_t > &  src,
ActivationLayerInfo  info,
const QuantizationInfo oq_info 
)

Definition at line 71 of file ActivationLayer.cpp.

References arm_compute::test::validation::convert_from_asymmetric(), arm_compute::test::validation::dst, QuantizationInfo::empty(), arm_compute::test::validation::info, and SimpleTensor< T >::quantization_info().

72 {
73  const QuantizationInfo dst_qinfo = oq_info.empty() ? src.quantization_info() : oq_info;
74 
75  SimpleTensor<float> src_tmp = convert_from_asymmetric(src);
76  SimpleTensor<float> dst_tmp = activation_layer<float>(src_tmp, info);
77  SimpleTensor<int8_t> dst = convert_to_asymmetric<int8_t>(dst_tmp, dst_qinfo);
78  return dst;
79 }
SimpleTensor< float > convert_from_asymmetric(const SimpleTensor< uint8_t > &src)
Definition: Helpers.cpp:36
SimpleTensor< float > src
Definition: DFT.cpp:155
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)

◆ activation_layer< uint8_t >()

SimpleTensor<uint8_t> arm_compute::test::validation::reference::activation_layer< uint8_t > ( const SimpleTensor< uint8_t > &  src,
ActivationLayerInfo  info,
const QuantizationInfo oq_info 
)

Definition at line 60 of file ActivationLayer.cpp.

References arm_compute::test::validation::convert_from_asymmetric(), arm_compute::test::validation::dst, QuantizationInfo::empty(), arm_compute::test::validation::info, and SimpleTensor< T >::quantization_info().

61 {
62  const QuantizationInfo dst_qinfo = oq_info.empty() ? src.quantization_info() : oq_info;
63 
64  SimpleTensor<float> src_tmp = convert_from_asymmetric(src);
65  SimpleTensor<float> dst_tmp = activation_layer<float>(src_tmp, info);
66  SimpleTensor<uint8_t> dst = convert_to_asymmetric<uint8_t>(dst_tmp, dst_qinfo);
67  return dst;
68 }
SimpleTensor< float > convert_from_asymmetric(const SimpleTensor< uint8_t > &src)
Definition: Helpers.cpp:36
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
QuantizationInfo quantization_info() const override
Quantization info in case of asymmetric quantized type.
Definition: SimpleTensor.h:332

◆ arithmetic_division() [1/3]

SimpleTensor< T > arithmetic_division ( const SimpleTensor< T > &  src1,
const SimpleTensor< T > &  src2,
DataType  data_type 
)

Definition at line 79 of file ArithmeticDivision.cpp.

References TensorShape::broadcast_shape(), arm_compute::test::validation::data_type, arm_compute::test::validation::dst, and SimpleTensor< T >::shape().

80 {
81  SimpleTensor<T> dst(TensorShape::broadcast_shape(src1.shape(), src2.shape()), data_type);
82 
83  Coordinates id_src1{};
84  Coordinates id_src2{};
85  Coordinates id_dst{};
86 
87  BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(src1, src2, dst, id_src1, id_src2, id_dst);
88 
89  return dst;
90 }
const DataType data_type
Definition: Im2Col.cpp:150

◆ arithmetic_division() [2/3]

template SimpleTensor<half> arm_compute::test::validation::reference::arithmetic_division ( const SimpleTensor< half > &  src1,
const SimpleTensor< half > &  src2,
DataType  data_type 
)

◆ arithmetic_division() [3/3]

template SimpleTensor<float> arm_compute::test::validation::reference::arithmetic_division ( const SimpleTensor< float > &  src1,
const SimpleTensor< float > &  src2,
DataType  data_type 
)

◆ arithmetic_operation() [1/13]

SimpleTensor< T > arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< T > &  src1,
const SimpleTensor< T > &  src2,
SimpleTensor< T > &  dst,
ConvertPolicy  convert_policy 
)

Definition at line 92 of file ArithmeticOperations.cpp.

References arm_compute::test::validation::dst.

Referenced by arithmetic_operation().

93 {
94  Coordinates id_src1{};
95  Coordinates id_src2{};
96  Coordinates id_dst{};
97 
98  BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1, src2, dst, convert_policy, id_src1, id_src2, id_dst);
99 
100  return dst;
101 }

◆ arithmetic_operation() [2/13]

SimpleTensor< uint8_t > arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< uint8_t > &  src1,
const SimpleTensor< uint8_t > &  src2,
SimpleTensor< uint8_t > &  dst,
ConvertPolicy  convert_policy 
)

Definition at line 104 of file ArithmeticOperations.cpp.

References TensorShape::broadcast_shape(), arm_compute::test::validation::convert_from_asymmetric(), SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, arm_compute::QASYMM8, SimpleTensor< T >::quantization_info(), and SimpleTensor< T >::shape().

105 {
106  Coordinates id_src1{};
107  Coordinates id_src2{};
108  Coordinates id_dst{};
109 
110  if(dst.data_type() == DataType::QASYMM8)
111  {
112  SimpleTensor<float> src1_tmp = convert_from_asymmetric(src1);
113  SimpleTensor<float> src2_tmp = convert_from_asymmetric(src2);
114  SimpleTensor<float> dst_tmp(TensorShape::broadcast_shape(src1.shape(), src2.shape()), dst.data_type());
115 
116  BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1_tmp, src2_tmp, dst_tmp, convert_policy, id_src1, id_src2, id_dst);
117 
118  dst = convert_to_asymmetric<uint8_t>(dst_tmp, dst.quantization_info());
119  return dst;
120  }
121  else
122  {
123  // DataType::U8
124  BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1, src2, dst, convert_policy, id_src1, id_src2, id_dst);
125 
126  return dst;
127  }
128 }
DataType data_type() const override
Data type of the tensor.
Definition: SimpleTensor.h:357
SimpleTensor< float > convert_from_asymmetric(const SimpleTensor< uint8_t > &src)
Definition: Helpers.cpp:36
TensorShape shape() const override
Shape of the tensor.
Definition: SimpleTensor.h:320
QuantizationInfo quantization_info() const override
Quantization info in case of asymmetric quantized type.
Definition: SimpleTensor.h:332

◆ arithmetic_operation() [3/13]

SimpleTensor< int8_t > arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< int8_t > &  src1,
const SimpleTensor< int8_t > &  src2,
SimpleTensor< int8_t > &  dst,
ConvertPolicy  convert_policy 
)

Definition at line 131 of file ArithmeticOperations.cpp.

References TensorShape::broadcast_shape(), arm_compute::test::validation::convert_from_asymmetric(), SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, arm_compute::QASYMM8_SIGNED, SimpleTensor< T >::quantization_info(), and SimpleTensor< T >::shape().

132 {
133  Coordinates id_src1{};
134  Coordinates id_src2{};
135  Coordinates id_dst{};
136 
137  if(dst.data_type() == DataType::QASYMM8_SIGNED)
138  {
139  SimpleTensor<float> src1_tmp = convert_from_asymmetric(src1);
140  SimpleTensor<float> src2_tmp = convert_from_asymmetric(src2);
141  SimpleTensor<float> dst_tmp(TensorShape::broadcast_shape(src1.shape(), src2.shape()), dst.data_type());
142 
143  BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1_tmp, src2_tmp, dst_tmp, convert_policy, id_src1, id_src2, id_dst);
144 
145  dst = convert_to_asymmetric<int8_t>(dst_tmp, dst.quantization_info());
146  return dst;
147  }
148  else
149  {
150  // DataType::S8
151  BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1, src2, dst, convert_policy, id_src1, id_src2, id_dst);
152 
153  return dst;
154  }
155 }
SimpleTensor< float > convert_from_asymmetric(const SimpleTensor< uint8_t > &src)
Definition: Helpers.cpp:36

◆ arithmetic_operation() [4/13]

SimpleTensor< int16_t > arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< int16_t > &  src1,
const SimpleTensor< int16_t > &  src2,
SimpleTensor< int16_t > &  dst,
ConvertPolicy  convert_policy 
)

Definition at line 158 of file ArithmeticOperations.cpp.

References arithmetic_operation(), TensorShape::broadcast_shape(), SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, arm_compute::QSYMM16, SimpleTensor< T >::quantization_info(), and SimpleTensor< T >::shape().

159 {
160  Coordinates id_src1{};
161  Coordinates id_src2{};
162  Coordinates id_dst{};
163 
164  if(dst.data_type() == DataType::QSYMM16)
165  {
166  SimpleTensor<float> src1_tmp = convert_from_symmetric<int16_t>(src1);
167  SimpleTensor<float> src2_tmp = convert_from_symmetric<int16_t>(src2);
168  SimpleTensor<float> dst_tmp(TensorShape::broadcast_shape(src1.shape(), src2.shape()), dst.data_type());
169 
170  BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1_tmp, src2_tmp, dst_tmp, convert_policy, id_src1, id_src2, id_dst);
171 
172  dst = convert_to_symmetric<int16_t>(dst_tmp, dst.quantization_info());
173  return dst;
174  }
175  else
176  {
177  // DataType::S16
178  BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1, src2, dst, convert_policy, id_src1, id_src2, id_dst);
179  return dst;
180  }
181 }

◆ arithmetic_operation() [5/13]

template SimpleTensor< int32_t > arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< int32_t > &  src1,
const SimpleTensor< int32_t > &  src2,
SimpleTensor< int32_t > &  dst,
ConvertPolicy  convert_policy 
)

◆ arithmetic_operation() [6/13]

template SimpleTensor< half > arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< half > &  src1,
const SimpleTensor< half > &  src2,
SimpleTensor< half > &  dst,
ConvertPolicy  convert_policy 
)

◆ arithmetic_operation() [7/13]

template SimpleTensor< float > arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< float > &  src1,
const SimpleTensor< float > &  src2,
SimpleTensor< float > &  dst,
ConvertPolicy  convert_policy 
)

◆ arithmetic_operation() [8/13]

SimpleTensor< T > arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< T > &  src1,
const SimpleTensor< T > &  src2,
DataType  dst_data_type,
ConvertPolicy  convert_policy 
)

Definition at line 188 of file ArithmeticOperations.cpp.

References arithmetic_operation(), ARM_COMPUTE_ERROR_ON_MSG, TensorShape::broadcast_shape(), arm_compute::test::validation::dst, arm_compute::is_data_type_quantized(), and SimpleTensor< T >::shape().

189 {
190  ARM_COMPUTE_ERROR_ON_MSG(is_data_type_quantized(dst_data_type), "For quantized input data types, the quantized output tensor should be passed directly.");
191 
192  SimpleTensor<T> dst(TensorShape::broadcast_shape(src1.shape(), src2.shape()), dst_data_type);
193  arithmetic_operation<T>(op, src1, src2, dst, convert_policy);
194  return dst;
195 }
bool is_data_type_quantized(DataType dt)
Check if a given data type is of quantized type.
Definition: Utils.h:981
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Definition: Error.h:456

◆ arithmetic_operation() [9/13]

template SimpleTensor< int32_t > arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< int32_t > &  src1,
const SimpleTensor< int32_t > &  src2,
DataType  dst_data_type,
ConvertPolicy  convert_policy 
)

◆ arithmetic_operation() [10/13]

template SimpleTensor< int16_t > arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< int16_t > &  src1,
const SimpleTensor< int16_t > &  src2,
DataType  dst_data_type,
ConvertPolicy  convert_policy 
)

◆ arithmetic_operation() [11/13]

template SimpleTensor< int8_t > arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< int8_t > &  src1,
const SimpleTensor< int8_t > &  src2,
DataType  dst_data_type,
ConvertPolicy  convert_policy 
)

◆ arithmetic_operation() [12/13]

template SimpleTensor< half > arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< half > &  src1,
const SimpleTensor< half > &  src2,
DataType  dst_data_type,
ConvertPolicy  convert_policy 
)

◆ arithmetic_operation() [13/13]

template SimpleTensor< float > arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< float > &  src1,
const SimpleTensor< float > &  src2,
DataType  dst_data_type,
ConvertPolicy  convert_policy 
)

◆ batch_normalization_layer() [1/3]

SimpleTensor< T > batch_normalization_layer ( const SimpleTensor< T > &  src,
const SimpleTensor< T > &  mean,
const SimpleTensor< T > &  var,
const SimpleTensor< T > &  beta,
const SimpleTensor< T > &  gamma,
float  epsilon,
ActivationLayerInfo  act_info 
)

Definition at line 40 of file BatchNormalizationLayer.cpp.

References activation_layer(), caffe_mnist_image_extractor::cols, SimpleTensor< T >::data_type(), ActivationLayerInfo::enabled(), arm_compute::quantization::epsilon, caffe_mnist_image_extractor::rows, SimpleTensor< T >::shape(), and arm_compute::test::validation::src.

42 {
43  SimpleTensor<T> result(src.shape(), src.data_type());
44 
45  const auto cols = static_cast<int>(src.shape()[0]);
46  const auto rows = static_cast<int>(src.shape()[1]);
47  const auto depth = static_cast<int>(src.shape()[2]);
48  const int upper_dims = src.shape().total_size() / (cols * rows * depth);
49 #if defined(_OPENMP)
50  #pragma omp parallel for schedule(dynamic, 1) collapse(4)
51 #endif /* _OPENMP */
52  for(int r = 0; r < upper_dims; ++r)
53  {
54  for(int i = 0; i < depth; ++i)
55  {
56  for(int k = 0; k < rows; ++k)
57  {
58  for(int l = 0; l < cols; ++l)
59  {
60  const int pos = l + k * cols + i * rows * cols + r * cols * rows * depth;
61  const float denominator = sqrt(var[i] + epsilon);
62  const float numerator = src[pos] - mean[i];
63  const float x_bar = numerator / denominator;
64  result[pos] = beta[i] + x_bar * gamma[i];
65  }
66  }
67  }
68  }
69 
70  if(act_info.enabled())
71  {
72  result = activation_layer(result, act_info);
73  }
74 
75  return result;
76 }
SimpleTensor< T > activation_layer(const SimpleTensor< T > &src, ActivationLayerInfo info, const QuantizationInfo &oq_info)
SimpleTensor< float > src
Definition: DFT.cpp:155

◆ batch_normalization_layer() [2/3]

template SimpleTensor<float> arm_compute::test::validation::reference::batch_normalization_layer ( const SimpleTensor< float > &  src,
const SimpleTensor< float > &  mean,
const SimpleTensor< float > &  var,
const SimpleTensor< float > &  beta,
const SimpleTensor< float > &  gamma,
float  epsilon,
ActivationLayerInfo  act_info 
)

◆ batch_normalization_layer() [3/3]

template SimpleTensor<half> arm_compute::test::validation::reference::batch_normalization_layer ( const SimpleTensor< half > &  src,
const SimpleTensor< half > &  mean,
const SimpleTensor< half > &  var,
const SimpleTensor< half > &  beta,
const SimpleTensor< half > &  gamma,
float  epsilon,
ActivationLayerInfo  act_info 
)

◆ batch_to_space() [1/3]

SimpleTensor< T > batch_to_space ( const SimpleTensor< T > &  src,
const SimpleTensor< int32_t > &  block_shape,
const TensorShape dst_shape 
)

Definition at line 38 of file BatchToSpaceLayer.cpp.

References ARM_COMPUTE_ERROR_ON, SimpleTensor< T >::data_type(), arm_compute::test::validation::dst_shape, SimpleTensor< T >::shape(), and arm_compute::test::validation::src.

39 {
40  ARM_COMPUTE_ERROR_ON(block_shape[0] <= 0);
41  ARM_COMPUTE_ERROR_ON(block_shape[1] <= 0);
42  SimpleTensor<T> result(dst_shape, src.data_type());
43 
44  int in_pos = 0;
45  const auto width_in = static_cast<int>(src.shape()[0]);
46  const auto height_in = static_cast<int>(src.shape()[1]);
47  const auto z_in = static_cast<int>(src.shape()[2]);
48  const auto batch_in = static_cast<int>(src.shape()[3]);
49 
50  for(int batch = 0; batch < batch_in; ++batch)
51  {
52  for(int z = 0; z < z_in; ++z)
53  {
54  for(int y = 0; y < height_in; ++y)
55  {
56  for(int x = 0; x < width_in; ++x)
57  {
58  const int r = src.shape()[3] / (block_shape[0] * block_shape[1]);
59  const int out_x = (block_shape[0] * x + (batch / r) % block_shape[0]);
60  const int out_y = (block_shape[1] * y + (batch / r) / block_shape[0]);
61  const int out_pos = out_x + dst_shape[0] * out_y + z * dst_shape[0] * dst_shape[1] + (batch % r) * dst_shape[0] * dst_shape[1] * dst_shape[2];
62  result[out_pos] = src[in_pos];
63  ++in_pos;
64  }
65  }
66  }
67  }
68 
69  return result;
70 }
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
SimpleTensor< float > src
Definition: DFT.cpp:155

◆ batch_to_space() [2/3]

template SimpleTensor<float> arm_compute::test::validation::reference::batch_to_space ( const SimpleTensor< float > &  src,
const SimpleTensor< int32_t > &  block_shape,
const TensorShape dst_shape 
)

◆ batch_to_space() [3/3]

template SimpleTensor<half> arm_compute::test::validation::reference::batch_to_space ( const SimpleTensor< half > &  src,
const SimpleTensor< int32_t > &  block_shape,
const TensorShape dst_shape 
)

◆ bitwise_and() [1/2]

SimpleTensor< T > bitwise_and ( const SimpleTensor< T > &  src1,
const SimpleTensor< T > &  src2 
)

Definition at line 35 of file BitwiseAnd.cpp.

References SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, SimpleTensor< T >::num_elements(), and SimpleTensor< T >::shape().

36 {
37  SimpleTensor<T> dst(src1.shape(), src1.data_type());
38 #if defined(_OPENMP)
39  #pragma omp parallel for
40 #endif /* _OPENMP */
41  for(int i = 0; i < src1.num_elements(); ++i)
42  {
43  dst[i] = src1[i] & src2[i];
44  }
45 
46  return dst;
47 }

◆ bitwise_and() [2/2]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::bitwise_and ( const SimpleTensor< uint8_t > &  src1,
const SimpleTensor< uint8_t > &  src2 
)

◆ bitwise_not() [1/2]

SimpleTensor< T > bitwise_not ( const SimpleTensor< T > &  src)

Definition at line 35 of file BitwiseNot.cpp.

References SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, SimpleTensor< T >::num_elements(), SimpleTensor< T >::shape(), and arm_compute::test::validation::src.

36 {
37  SimpleTensor<T> dst(src.shape(), src.data_type());
38 #if defined(_OPENMP)
39  #pragma omp parallel for
40 #endif /* _OPENMP */
41  for(int i = 0; i < src.num_elements(); ++i)
42  {
43  dst[i] = ~src[i];
44  }
45 
46  return dst;
47 }
SimpleTensor< float > src
Definition: DFT.cpp:155

◆ bitwise_not() [2/2]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::bitwise_not ( const SimpleTensor< uint8_t > &  src)

◆ bitwise_or() [1/2]

SimpleTensor< T > bitwise_or ( const SimpleTensor< T > &  src1,
const SimpleTensor< T > &  src2 
)

Definition at line 35 of file BitwiseOr.cpp.

References SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, SimpleTensor< T >::num_elements(), and SimpleTensor< T >::shape().

36 {
37  SimpleTensor<T> dst(src1.shape(), src1.data_type());
38 #if defined(_OPENMP)
39  #pragma omp parallel for
40 #endif /* _OPENMP */
41  for(int i = 0; i < src1.num_elements(); ++i)
42  {
43  dst[i] = src1[i] | src2[i];
44  }
45 
46  return dst;
47 }

◆ bitwise_or() [2/2]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::bitwise_or ( const SimpleTensor< uint8_t > &  src1,
const SimpleTensor< uint8_t > &  src2 
)

◆ bitwise_xor() [1/2]

SimpleTensor< T > bitwise_xor ( const SimpleTensor< T > &  src1,
const SimpleTensor< T > &  src2 
)

Definition at line 35 of file BitwiseXor.cpp.

References SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, SimpleTensor< T >::num_elements(), and SimpleTensor< T >::shape().

36 {
37  SimpleTensor<T> dst(src1.shape(), src1.data_type());
38 #if defined(_OPENMP)
39  #pragma omp parallel for
40 #endif /* _OPENMP */
41  for(int i = 0; i < src1.num_elements(); ++i)
42  {
43  dst[i] = src1[i] ^ src2[i];
44  }
45 
46  return dst;
47 }

◆ bitwise_xor() [2/2]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::bitwise_xor ( const SimpleTensor< uint8_t > &  src1,
const SimpleTensor< uint8_t > &  src2 
)

◆ bounding_box_transform() [1/4]

SimpleTensor< T > bounding_box_transform ( const SimpleTensor< T > &  boxes,
const SimpleTensor< TDeltas > &  deltas,
const BoundingBoxTransformInfo info 
)

Definition at line 40 of file BoundingBoxTransform.cpp.

References BoundingBoxTransformInfo::apply_scale(), ARM_COMPUTE_ERROR_ON, BoundingBoxTransformInfo::bbox_xform_clip(), BoundingBoxTransformInfo::correct_transform_coords(), SimpleTensor< T >::data(), SimpleTensor< T >::data_type(), BoundingBoxTransformInfo::img_height(), BoundingBoxTransformInfo::img_width(), arm_compute::test::validation::info, offset(), BoundingBoxTransformInfo::scale(), SimpleTensor< T >::shape(), and BoundingBoxTransformInfo::weights().

41 {
42  const DataType boxes_data_type = boxes.data_type();
43  SimpleTensor<T> pred_boxes(deltas.shape(), boxes_data_type);
44 
45  const size_t num_classes = deltas.shape()[0] / 4;
46  const size_t num_boxes = deltas.shape()[1];
47  const TDeltas *deltas_ptr = deltas.data();
48  T *pred_boxes_ptr = pred_boxes.data();
49 
50  const int img_h = floor(info.img_height() / info.scale() + 0.5f);
51  const int img_w = floor(info.img_width() / info.scale() + 0.5f);
52 
53  const auto scale_after = (info.apply_scale() ? T(info.scale()) : T(1));
54  const auto scale_before = T(info.scale());
55  ARM_COMPUTE_ERROR_ON(scale_before <= 0);
56  const auto offset = (info.correct_transform_coords() ? T(1.f) : T(0.f));
57 
58  const size_t box_fields = 4;
59  const size_t class_fields = 4;
60 #if defined(_OPENMP)
61  #pragma omp parallel for
62 #endif /* _OPENMP */
63  for(size_t i = 0; i < num_boxes; ++i)
64  {
65  // Extract ROI information
66  const size_t start_box = box_fields * i;
67  const T width = (boxes[start_box + 2] / scale_before) - (boxes[start_box] / scale_before) + T(1.f);
68  const T height = (boxes[start_box + 3] / scale_before) - (boxes[start_box + 1] / scale_before) + T(1.f);
69  const T ctr_x = (boxes[start_box] / scale_before) + T(0.5f) * width;
70  const T ctr_y = (boxes[start_box + 1] / scale_before) + T(0.5f) * height;
71 
72  for(size_t j = 0; j < num_classes; ++j)
73  {
74  // Extract deltas
75  const size_t start_delta = i * num_classes * class_fields + class_fields * j;
76  const TDeltas dx = deltas_ptr[start_delta] / TDeltas(info.weights()[0]);
77  const TDeltas dy = deltas_ptr[start_delta + 1] / TDeltas(info.weights()[1]);
78  TDeltas dw = deltas_ptr[start_delta + 2] / TDeltas(info.weights()[2]);
79  TDeltas dh = deltas_ptr[start_delta + 3] / TDeltas(info.weights()[3]);
80 
81  // Clip dw and dh
82  dw = std::min(dw, TDeltas(info.bbox_xform_clip()));
83  dh = std::min(dh, TDeltas(info.bbox_xform_clip()));
84 
85  // Determine the predictions
86  const T pred_ctr_x = dx * width + ctr_x;
87  const T pred_ctr_y = dy * height + ctr_y;
88  const T pred_w = T(std::exp(dw)) * width;
89  const T pred_h = T(std::exp(dh)) * height;
90 
91  // Store the prediction into the output tensor
92  pred_boxes_ptr[start_delta] = scale_after * utility::clamp<T>(pred_ctr_x - T(0.5f) * pred_w, T(0), T(img_w - 1));
93  pred_boxes_ptr[start_delta + 1] = scale_after * utility::clamp<T>(pred_ctr_y - T(0.5f) * pred_h, T(0), T(img_h - 1));
94  pred_boxes_ptr[start_delta + 2] = scale_after * utility::clamp<T>(pred_ctr_x + T(0.5f) * pred_w - offset, T(0), T(img_w - 1));
95  pred_boxes_ptr[start_delta + 3] = scale_after * utility::clamp<T>(pred_ctr_y + T(0.5f) * pred_h - offset, T(0), T(img_h - 1));
96  }
97  }
98  return pred_boxes;
99 }
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
Definition: helpers.h:861
DataType
Definition: Acl.hpp:485
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)

◆ bounding_box_transform() [2/4]

template SimpleTensor<float> arm_compute::test::validation::reference::bounding_box_transform ( const SimpleTensor< float > &  boxes,
const SimpleTensor< float > &  deltas,
const BoundingBoxTransformInfo info 
)

◆ bounding_box_transform() [3/4]

template SimpleTensor<half> arm_compute::test::validation::reference::bounding_box_transform ( const SimpleTensor< half > &  boxes,
const SimpleTensor< half > &  deltas,
const BoundingBoxTransformInfo info 
)

◆ bounding_box_transform() [4/4]

SimpleTensor<uint16_t> arm_compute::test::validation::reference::bounding_box_transform ( const SimpleTensor< uint16_t > &  boxes,
const SimpleTensor< uint8_t > &  deltas,
const BoundingBoxTransformInfo info 
)

Definition at line 105 of file BoundingBoxTransform.cpp.

References arm_compute::test::validation::convert_from_asymmetric(), arm_compute::test::validation::info, and SimpleTensor< T >::quantization_info().

106 {
107  SimpleTensor<float> boxes_tmp = convert_from_asymmetric(boxes);
108  SimpleTensor<float> deltas_tmp = convert_from_asymmetric(deltas);
109  SimpleTensor<float> pred_boxes_tmp = bounding_box_transform<float, float>(boxes_tmp, deltas_tmp, info);
110  SimpleTensor<uint16_t> pred_boxes = convert_to_asymmetric<uint16_t>(pred_boxes_tmp, boxes.quantization_info());
111  return pred_boxes;
112 }
SimpleTensor< float > convert_from_asymmetric(const SimpleTensor< uint8_t > &src)
Definition: Helpers.cpp:36
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)

◆ channel_shuffle() [1/6]

SimpleTensor< T > channel_shuffle ( const SimpleTensor< T > &  src,
int  num_groups 
)

Definition at line 39 of file ChannelShuffle.cpp.

References batches, copy(), SimpleTensor< T >::data(), SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, arm_compute::test::validation::dst_ref, M, N, SimpleTensor< T >::num_channels(), arm_compute::test::validation::num_groups, SimpleTensor< T >::quantization_info(), SimpleTensor< T >::shape(), arm_compute::test::validation::src, and arm_compute::test::validation::src_ref.

40 {
41  // Create reference
42  SimpleTensor<T> dst{ src.shape(), src.data_type(), src.num_channels(), src.quantization_info() };
43 
44  const int M = src.shape()[0];
45  const int N = src.shape()[1];
46  const int num_channels = src.shape()[2];
47  const int batches = src.shape()[3];
48  const int MxN = M * N;
49  const int channels_in_group = num_channels / num_groups;
50 
51  const T *src_ref = src.data();
52  T *dst_ref = dst.data();
53 #if defined(_OPENMP)
54  #pragma omp parallel for collapse(2)
55 #endif /* _OPENMP */
56  for(int n = 0; n < batches; ++n)
57  {
58  for(int g = 0; g < num_groups; ++g)
59  {
60  // Gather the group g block (of size channels_in_group * MxN) from output channels
61  // g + 0 * G, g + 1 * G, g + 2 * G, g + G * (K - 1) etc.
62  const T *src_ptr = src_ref + g * channels_in_group * MxN + n * num_channels * MxN;
63  T *dst_ptr = dst_ref + g * MxN + n * num_channels * MxN;
64  for(int i = 0; i < channels_in_group; ++i)
65  {
66  std::copy(src_ptr + i * MxN,
67  src_ptr + (i + 1) * MxN,
68  dst_ptr + i * num_groups * MxN);
69  }
70  }
71  }
72 
73  return dst;
74 }
unsigned int M
SimpleTensor< T > copy(const SimpleTensor< T > &src, const TensorShape &output_shape)
Definition: Copy.cpp:37
SimpleTensor< float > src
Definition: DFT.cpp:155
const unsigned int num_groups
Definition: Im2Col.cpp:153
unsigned int N
SimpleTensor< float > src_ref
Definition: Im2Col.cpp:197
unsigned int batches

◆ channel_shuffle() [2/6]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::channel_shuffle ( const SimpleTensor< uint8_t > &  src,
int  num_groups 
)

◆ channel_shuffle() [3/6]

template SimpleTensor<uint16_t> arm_compute::test::validation::reference::channel_shuffle ( const SimpleTensor< uint16_t > &  src,
int  num_groups 
)

◆ channel_shuffle() [4/6]

template SimpleTensor<uint32_t> arm_compute::test::validation::reference::channel_shuffle ( const SimpleTensor< uint32_t > &  src,
int  num_groups 
)

◆ channel_shuffle() [5/6]

template SimpleTensor<half> arm_compute::test::validation::reference::channel_shuffle ( const SimpleTensor< half > &  src,
int  num_groups 
)

◆ channel_shuffle() [6/6]

template SimpleTensor<float> arm_compute::test::validation::reference::channel_shuffle ( const SimpleTensor< float > &  src,
int  num_groups 
)

◆ col2im() [1/4]

SimpleTensor< T > col2im ( const SimpleTensor< T > &  src,
const TensorShape dst_shape,
unsigned int  num_groups 
)

Definition at line 38 of file Col2Im.cpp.

References arm_compute::test::validation::b, batches, arm_compute::test::coord2index(), SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, arm_compute::test::validation::dst_shape, arm_compute::test::validation::num_groups, SimpleTensor< T >::shape(), arm_compute::test::validation::src, TensorShape::total_size(), Dimensions< T >::x(), Dimensions< T >::y(), and Dimensions< T >::z().

39 {
40  SimpleTensor<T> dst{ dst_shape, src.data_type(), 1 };
41 
42  // Compute reference
43  const size_t batches = dst_shape.total_size() / (dst_shape.x() * dst_shape.y() * dst_shape.z());
44  const size_t src_width = src.shape().x();
45  const size_t src_height = src.shape().y();
46 
47  if(num_groups == 1)
48  {
49  // Batches are on the 3rd dimension of the input tensor
50 #if defined(_OPENMP)
51  #pragma omp parallel for collapse(3)
52 #endif /* _OPENMP */
53  for(size_t b = 0; b < batches; ++b)
54  {
55  for(size_t x = 0; x < src_width; ++x)
56  {
57  for(size_t y = 0; y < src_height; ++y)
58  {
59  const int dst_idx = y + x * src_height + b * src_height * src_width;
60  dst[dst_idx] = src[coord2index(src.shape(), Coordinates(x, y, b))];
61  }
62  }
63  }
64  }
65  else
66  {
67 #if defined(_OPENMP)
68  #pragma omp parallel for collapse(4)
69 #endif /* _OPENMP */
70  for(size_t b = 0; b < batches; ++b)
71  {
72  for(size_t g = 0; g < num_groups; ++g)
73  {
74  for(size_t x = 0; x < src_width; ++x)
75  {
76  for(size_t y = 0; y < src_height; ++y)
77  {
78  const int dst_idx = y + x * src_height + g * src_height * src_width + b * src_height * src_width * num_groups;
79  dst[dst_idx] = src[coord2index(src.shape(), Coordinates(x, y, g, b))];
80  }
81  }
82  }
83  }
84  }
85  return dst;
86 }
SimpleTensor< float > b
Definition: DFT.cpp:157
SimpleTensor< float > src
Definition: DFT.cpp:155
int coord2index(const TensorShape &shape, const Coordinates &coord)
Linearise the given coordinate.
Definition: Utils.h:387
T x() const
Alias to access the size of the first dimension.
Definition: Dimensions.h:87
T z() const
Alias to access the size of the third dimension.
Definition: Dimensions.h:97
const unsigned int num_groups
Definition: Im2Col.cpp:153
size_t total_size() const
Collapses all dimensions to a single linear total size.
Definition: TensorShape.h:172
T y() const
Alias to access the size of the second dimension.
Definition: Dimensions.h:92
unsigned int batches

◆ col2im() [2/4]

template SimpleTensor<float> arm_compute::test::validation::reference::col2im ( const SimpleTensor< float > &  src,
const TensorShape dst_shape,
unsigned int  num_groups 
)

◆ col2im() [3/4]

template SimpleTensor<half> arm_compute::test::validation::reference::col2im ( const SimpleTensor< half > &  src,
const TensorShape dst_shape,
unsigned int  num_groups 
)

◆ col2im() [4/4]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::col2im ( const SimpleTensor< uint8_t > &  src,
const TensorShape dst_shape,
unsigned int  num_groups 
)

◆ compare() [1/5]

SimpleTensor< uint8_t > compare ( ComparisonOperation  op,
const SimpleTensor< T > &  src1,
const SimpleTensor< T > &  src2 
)

Definition at line 111 of file Comparisons.cpp.

References TensorShape::broadcast_shape(), arm_compute::test::validation::dst, SimpleTensor< T >::shape(), and arm_compute::U8.

Referenced by compare().

112 {
113  SimpleTensor<uint8_t> dst(TensorShape::broadcast_shape(src1.shape(), src2.shape()), DataType::U8);
114 
115  Coordinates id_src1{};
116  Coordinates id_src2{};
117  Coordinates id_dst{};
118  BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1, src2, dst, id_src1, id_src2, id_dst);
119  return dst;
120 }

◆ compare() [2/5]

SimpleTensor<uint8_t> arm_compute::test::validation::reference::compare ( ComparisonOperation  op,
const SimpleTensor< uint8_t > &  src1,
const SimpleTensor< uint8_t > &  src2 
)

Definition at line 123 of file Comparisons.cpp.

References TensorShape::broadcast_shape(), arm_compute::test::validation::convert_from_asymmetric(), SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, arm_compute::QASYMM8, SimpleTensor< T >::shape(), and arm_compute::U8.

124 {
125  SimpleTensor<uint8_t> dst(TensorShape::broadcast_shape(src1.shape(), src2.shape()), DataType::U8);
126 
127  Coordinates id_src1{};
128  Coordinates id_src2{};
129  Coordinates id_dst{};
130 
131  if(src1.data_type() == DataType::QASYMM8)
132  {
133  SimpleTensor<float> src1_tmp = convert_from_asymmetric(src1);
134  SimpleTensor<float> src2_tmp = convert_from_asymmetric(src2);
135  BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1_tmp, src2_tmp, dst, id_src1, id_src2, id_dst);
136  }
137  else
138  {
139  // DataType::U8
140  BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1, src2, dst, id_src1, id_src2, id_dst);
141  }
142  return dst;
143 }
DataType data_type() const override
Data type of the tensor.
Definition: SimpleTensor.h:357
SimpleTensor< float > convert_from_asymmetric(const SimpleTensor< uint8_t > &src)
Definition: Helpers.cpp:36
TensorShape shape() const override
Shape of the tensor.
Definition: SimpleTensor.h:320

◆ compare() [3/5]

SimpleTensor<uint8_t> arm_compute::test::validation::reference::compare ( ComparisonOperation  op,
const SimpleTensor< int8_t > &  src1,
const SimpleTensor< int8_t > &  src2 
)

Definition at line 146 of file Comparisons.cpp.

References TensorShape::broadcast_shape(), compare(), arm_compute::test::validation::convert_from_asymmetric(), SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, arm_compute::QASYMM8_SIGNED, SimpleTensor< T >::shape(), and arm_compute::U8.

147 {
148  SimpleTensor<uint8_t> dst(TensorShape::broadcast_shape(src1.shape(), src2.shape()), DataType::U8);
149 
150  Coordinates id_src1{};
151  Coordinates id_src2{};
152  Coordinates id_dst{};
153 
154  if(src1.data_type() == DataType::QASYMM8_SIGNED)
155  {
156  SimpleTensor<float> src1_tmp = convert_from_asymmetric(src1);
157  SimpleTensor<float> src2_tmp = convert_from_asymmetric(src2);
158  BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1_tmp, src2_tmp, dst, id_src1, id_src2, id_dst);
159  }
160  else
161  {
162  // DataType::U8
163  BroadcastUnroll<Coordinates::num_max_dimensions>::unroll(op, src1, src2, dst, id_src1, id_src2, id_dst);
164  }
165  return dst;
166 }
SimpleTensor< float > convert_from_asymmetric(const SimpleTensor< uint8_t > &src)
Definition: Helpers.cpp:36

◆ compare() [4/5]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::compare ( ComparisonOperation  op,
const SimpleTensor< half > &  src1,
const SimpleTensor< half > &  src2 
)

◆ compare() [5/5]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::compare ( ComparisonOperation  op,
const SimpleTensor< float > &  src1,
const SimpleTensor< float > &  src2 
)

◆ compute_all_anchors() [1/4]

SimpleTensor< T > compute_all_anchors ( const SimpleTensor< T > &  anchors,
const ComputeAnchorsInfo info 
)

Definition at line 40 of file ComputeAllAnchors.cpp.

References SimpleTensor< T >::data(), SimpleTensor< T >::data_type(), ComputeAnchorsInfo::feat_height(), ComputeAnchorsInfo::feat_width(), arm_compute::test::validation::info, SimpleTensor< T >::shape(), and ComputeAnchorsInfo::spatial_scale().

Referenced by compute_all_anchors().

41 {
42  const int num_anchors = anchors.shape()[1];
43  const auto width = int(info.feat_width());
44  const auto height = int(info.feat_height());
45  const float stride = 1. / info.spatial_scale();
46 
47  SimpleTensor<T> all_anchors(TensorShape(4, width * height * num_anchors), anchors.data_type());
48  const T *anchors_ptr = anchors.data();
49  T *all_anchors_ptr = all_anchors.data();
50 
51  // Iterate over the input grid and anchors
52 #if defined(_OPENMP)
53  #pragma omp parallel for schedule(dynamic, 1) collapse(3)
54 #endif /* _OPENMP */
55  for(int y = 0; y < height; y++)
56  {
57  for(int x = 0; x < width; x++)
58  {
59  for(int a = 0; a < num_anchors; a++)
60  {
61  const T shift_x = T(x) * T(stride);
62  const T shift_y = T(y) * T(stride);
63  const size_t anchor_id = a + x * num_anchors + y * width * num_anchors;
64  // x1
65  all_anchors_ptr[anchor_id * 4] = anchors_ptr[4 * a] + shift_x;
66  // y1
67  all_anchors_ptr[anchor_id * 4 + 1] = anchors_ptr[4 * a + 1] + shift_y;
68  // x2
69  all_anchors_ptr[anchor_id * 4 + 2] = anchors_ptr[4 * a + 2] + shift_x;
70  // y2
71  all_anchors_ptr[anchor_id * 4 + 3] = anchors_ptr[4 * a + 3] + shift_y;
72  }
73  }
74  }
75  return all_anchors;
76 }
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)

◆ compute_all_anchors() [2/4]

template SimpleTensor<float> arm_compute::test::validation::reference::compute_all_anchors ( const SimpleTensor< float > &  anchors,
const ComputeAnchorsInfo info 
)

◆ compute_all_anchors() [3/4]

template SimpleTensor<half> arm_compute::test::validation::reference::compute_all_anchors ( const SimpleTensor< half > &  anchors,
const ComputeAnchorsInfo info 
)

◆ compute_all_anchors() [4/4]

SimpleTensor<int16_t> arm_compute::test::validation::reference::compute_all_anchors ( const SimpleTensor< int16_t > &  anchors,
const ComputeAnchorsInfo info 
)

Definition at line 81 of file ComputeAllAnchors.cpp.

References compute_all_anchors(), arm_compute::test::validation::convert_from_symmetric(), and SimpleTensor< T >::quantization_info().

82 {
83  SimpleTensor<float> anchors_tmp = convert_from_symmetric(anchors);
84  SimpleTensor<float> all_anchors_tmp = compute_all_anchors(anchors_tmp, info);
85  SimpleTensor<int16_t> all_anchors = convert_to_symmetric<int16_t>(all_anchors_tmp, anchors.quantization_info());
86  return all_anchors;
87 }
SimpleTensor< int16_t > compute_all_anchors(const SimpleTensor< int16_t > &anchors, const ComputeAnchorsInfo &info)
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
SimpleTensor< float > convert_from_symmetric(const SimpleTensor< int16_t > &src)
Definition: Helpers.cpp:147

◆ compute_min_max()

void arm_compute::test::validation::reference::compute_min_max ( const SimpleTensor< T > &  src,
T &  min,
T &  max 
)

Definition at line 35 of file MinMaxLocation.cpp.

References ARM_COMPUTE_ERROR_ON, and SimpleTensor< T >::num_elements().

36 {
37  // Set min and max to first pixel
38  min = src[0];
39  max = src[0];
40 
41  ARM_COMPUTE_ERROR_ON(src.num_elements() == 0);
42 
43  // Look for min and max values
44  for(int i = 1; i < src.num_elements(); ++i)
45  {
46  if(src[i] < min)
47  {
48  min = src[i];
49  }
50  if(src[i] > max)
51  {
52  max = src[i];
53  }
54  }
55 }
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
SimpleTensor< float > src
Definition: DFT.cpp:155

◆ compute_reduction_operation()

SimpleTensor<OT> arm_compute::test::validation::reference::compute_reduction_operation ( const SimpleTensor< T > &  src,
const TensorShape dst_shape,
unsigned int  axis,
ReductionOperation  op 
)

Definition at line 178 of file ReductionOperation.cpp.

References arm_compute::ARG_IDX_MAX, arm_compute::ARG_IDX_MIN, ARM_COMPUTE_ERROR, SimpleTensor< T >::data(), SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, arm_compute::test::validation::dst_shape, SimpleTensor< T >::quantization_info(), arm_compute::S32, and SimpleTensor< T >::shape().

179 {
180  // Create reference
181  const bool is_arg_min_max = (op == ReductionOperation::ARG_IDX_MIN || op == ReductionOperation::ARG_IDX_MAX);
182  DataType output_data_type = is_arg_min_max ? DataType::S32 : src.data_type();
183  SimpleTensor<OT> dst{ dst_shape, output_data_type, 1, src.quantization_info() };
184  const unsigned int src_width = src.shape().x();
185  const unsigned int src_height = src.shape().y();
186  const unsigned int src_depth = src.shape().z();
187  const unsigned int src_batch = src.shape()[3];
188  const int reduce_elems = src.shape()[axis];
189 
190  switch(axis)
191  {
192  case 0:
193  {
194  const unsigned int upper_dims = src.shape().total_size_upper(1);
195  for(unsigned int du = 0; du < upper_dims; ++du)
196  {
197  const T *src_row_ptr = src.data() + du * reduce_elems;
198  dst[du] = is_arg_min_max ?
199  reduce_operation_arg_min_max<T, OT>(src_row_ptr, reduce_elems, op, 1) :
200  reduce_operation<T, OT>(src_row_ptr, reduce_elems, op, 1);
201  }
202  }
203  break;
204  case 1:
205  {
206  const unsigned int upper_dims = src.shape().total_size_upper(2);
207  for(unsigned int du = 0; du < upper_dims; ++du)
208  {
209  for(unsigned int x = 0; x < src_width; ++x)
210  {
211  const int in_offset = du * src_height * src_width + x;
212  const int out_offset = du * src_width + x;
213  const T *src_row_ptr = src.data() + in_offset;
214  dst[out_offset] = is_arg_min_max ?
215  reduce_operation_arg_min_max<T, OT>(src_row_ptr, reduce_elems, op, src_width) :
216  reduce_operation<T, OT>(src_row_ptr, reduce_elems, op, src_width);
217  }
218  }
219  }
220  break;
221  case 2:
222  {
223  const unsigned int upper_dims = src.shape().total_size_upper(3);
224  for(unsigned int du = 0; du < upper_dims; ++du)
225  {
226  for(unsigned int x = 0; x < src_width; ++x)
227  {
228  for(unsigned int y = 0; y < src_height; ++y)
229  {
230  const int in_offset = du * src_depth * src_height * src_width + y * src_width + x;
231  const int out_offset = du * src_width * src_height + y * src_width + x;
232  const T *src_row_ptr = src.data() + in_offset;
233  dst[out_offset] = is_arg_min_max ?
234  reduce_operation_arg_min_max<T, OT>(src_row_ptr, reduce_elems, op, src_width * src_height) :
235  reduce_operation<T, OT>(src_row_ptr, reduce_elems, op, src_width * src_height);
236  }
237  }
238  }
239  }
240  break;
241  case 3:
242  {
243  const unsigned int upper_dims = src.shape().total_size_upper(4);
244  for(unsigned int du = 0; du < upper_dims; ++du)
245  {
246  for(unsigned int z = 0; z < src_depth; ++z)
247  {
248  for(unsigned int y = 0; y < src_height; ++y)
249  {
250  for(unsigned int x = 0; x < src_width; ++x)
251  {
252  const int in_offset = du * src_batch * src_depth * src_height * src_width + z * src_width * src_height + y * src_width + x;
253  const int out_offset = du * src_depth * src_height * src_width + z * src_width * src_height + y * src_width + x;
254  const T *src_row_ptr = src.data() + in_offset;
255  dst[out_offset] = is_arg_min_max ?
256  reduce_operation_arg_min_max<T, OT>(src_row_ptr, reduce_elems, op, src_width * src_height * src_depth) :
257  reduce_operation<T, OT>(src_row_ptr, reduce_elems, op, src_width * src_height * src_depth);
258  }
259  }
260  }
261  }
262  }
263  break;
264  default:
265  ARM_COMPUTE_ERROR("Unsupported reduction axis");
266  }
267 
268  return dst;
269 }
DataType
Definition: Acl.hpp:485
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352
SimpleTensor< float > src
Definition: DFT.cpp:155

◆ concatenate_layer() [1/5]

SimpleTensor< T > concatenate_layer ( std::vector< SimpleTensor< T >> &  srcs,
SimpleTensor< T > &  dst,
unsigned int  axis 
)

Definition at line 116 of file ConcatenateLayer.cpp.

References ARM_COMPUTE_ERROR, Window::DimX, Window::DimY, Window::DimZ, arm_compute::test::validation::dst, tf_frozen_model_extractor::t, and arm_compute::utils::cast::U.

117 {
118  switch(axis)
119  {
120  case Window::DimX:
121  {
122  return widthconcatenate_layer(srcs, dst);
123  }
124  case Window::DimY:
125  {
126  for(auto &t : srcs)
127  {
128  t = reference::permute<T>(t, PermutationVector(1U, 0U));
129  }
130  dst = reference::permute<T>(dst, PermutationVector(1U, 0U));
131  return reference::permute<T>(widthconcatenate_layer(srcs, dst), PermutationVector(1U, 0U));
132  }
133  case Window::DimZ:
134  {
135  for(auto &t : srcs)
136  {
137  t = reference::permute<T>(t, PermutationVector(2U, 1U, 0U));
138  }
139  dst = reference::permute<T>(dst, PermutationVector(2U, 1U, 0U));
140  return reference::permute<T>(widthconcatenate_layer(srcs, dst), PermutationVector(2U, 1U, 0U));
141  }
142  case 3:
143  {
144  for(auto &t : srcs)
145  {
146  t = reference::permute<T>(t, PermutationVector(3U, 2U, 1U, 0U));
147  }
148  dst = reference::permute<T>(dst, PermutationVector(3U, 2U, 1U, 0U));
149  auto ret = reference::permute<T>(widthconcatenate_layer(srcs, dst), PermutationVector(3U, 2U, 1U, 0U));
150  return ret;
151  }
152  default:
153  {
154  ARM_COMPUTE_ERROR("Not supported");
155  return dst;
156  }
157  }
158 }
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352
Strides PermutationVector
Permutation vector.
Definition: Types.h:49

◆ concatenate_layer() [2/5]

template SimpleTensor<float> arm_compute::test::validation::reference::concatenate_layer ( std::vector< SimpleTensor< float >> &  srcs,
SimpleTensor< float > &  dst,
unsigned int  axis 
)

◆ concatenate_layer() [3/5]

template SimpleTensor<half> arm_compute::test::validation::reference::concatenate_layer ( std::vector< SimpleTensor< half >> &  srcs,
SimpleTensor< half > &  dst,
unsigned int  axis 
)

◆ concatenate_layer() [4/5]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::concatenate_layer ( std::vector< SimpleTensor< uint8_t >> &  srcs,
SimpleTensor< uint8_t > &  dst,
unsigned int  axis 
)

◆ concatenate_layer() [5/5]

template SimpleTensor<int8_t> arm_compute::test::validation::reference::concatenate_layer ( std::vector< SimpleTensor< int8_t >> &  srcs,
SimpleTensor< int8_t > &  dst,
unsigned int  axis 
)

◆ conv2d_dft() [1/3]

SimpleTensor< T > conv2d_dft ( const SimpleTensor< T > &  src,
const SimpleTensor< T > &  w,
const PadStrideInfo conv_info 
)

Performs and DFT based convolution on a real input.

Parameters
[in]srcSource tensor.
[in]wWeights tensor.
[in]conv_infoConvolution related metadata.
Returns
The output tensor.

Definition at line 396 of file DFT.cpp.

References arm_compute::test::validation::conv_info, copy(), dft_1d(), dft_2d(), PadStrideInfo::pad_bottom(), pad_layer(), PadStrideInfo::pad_left(), PadStrideInfo::pad_right(), PadStrideInfo::pad_top(), rdft_1d(), rdft_2d(), reverse(), ridft_1d(), ridft_2d(), SimpleTensor< T >::shape(), slice(), arm_compute::utils::cast::U, arm_compute::U32, and arm_compute::test::validation::w.

397 {
398  // Pad input to full padding
399  const PaddingList padding_in = { { 0, w.shape()[0] - 1 }, { 0, w.shape()[1] - 1 } };
400  auto padded_src = pad_layer(src, padding_in);
401 
402  // Flip weights
403  std::vector<uint32_t> axis_v = { 0, 1 };
404  SimpleTensor<uint32_t> axis{ TensorShape(2U), DataType::U32 };
405  std::copy(axis_v.begin(), axis_v.begin() + axis.shape().x(), axis.data());
406  auto flipped_w = reverse(w, axis);
407 
408  // Pad weights to have the same size as input
409  const PaddingList paddings_w = { { 0, src.shape()[0] - 1 }, { 0, src.shape()[1] - 1 } };
410  auto padded_w = pad_layer(flipped_w, paddings_w);
411 
412  // Transform input and weights to frequency domain
413  auto Fsrc = rdft_2d(padded_src);
414  auto Fw = rdft_2d(padded_w);
415 
416  // Perform dot product
417  auto Fdst = complex_mul_and_reduce(Fsrc, Fw);
418 
419  // Transform output back to frequency domain
420  auto conv_res = ridft_2d(Fdst);
421 
422  // Slice output
423  const int start_left = w.shape().x() - conv_info.pad_left() - 1;
424  const int start_top = w.shape().y() - conv_info.pad_top() - 1;
425  const int end_right = conv_res.shape().x() - (w.shape().x() - conv_info.pad_right() - 1);
426  const int end_botton = conv_res.shape().y() - (w.shape().y() - conv_info.pad_bottom() - 1);
427  return slice(conv_res, Coordinates(start_left, start_top), Coordinates(end_right, end_botton));
428 }
SimpleTensor< T > pad_layer(const SimpleTensor< T > &src, const PaddingList &paddings, const PixelValue const_value, const PaddingMode mode)
Reference function to pad an ND tensor.
Definition: PadLayer.cpp:39
SimpleTensor< T > reverse(const SimpleTensor< T > &src, const SimpleTensor< uint32_t > &axis)
Definition: Reverse.cpp:38
template SimpleTensor< half > ridft_2d(const SimpleTensor< half > &src, bool is_odd)
SimpleTensor< float > w
Definition: DFT.cpp:156
std::vector< PaddingInfo > PaddingList
List of padding information.
Definition: Types.h:431
SimpleTensor< T > copy(const SimpleTensor< T > &src, const TensorShape &output_shape)
Definition: Copy.cpp:37
SimpleTensor< float > src
Definition: DFT.cpp:155
template SimpleTensor< half > rdft_2d(const SimpleTensor< half > &src)
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)

◆ conv2d_dft() [2/3]

template SimpleTensor<float> arm_compute::test::validation::reference::conv2d_dft ( const SimpleTensor< float > &  src,
const SimpleTensor< float > &  w,
const PadStrideInfo conv_info 
)

◆ conv2d_dft() [3/3]

template SimpleTensor<half> arm_compute::test::validation::reference::conv2d_dft ( const SimpleTensor< half > &  src,
const SimpleTensor< half > &  w,
const PadStrideInfo conv_info 
)

◆ convert_fully_connected_weights() [1/4]

SimpleTensor< T > convert_fully_connected_weights ( const SimpleTensor< T > &  src,
const TensorShape original_input_shape,
const DataLayout  training_data_layout 
)

Definition at line 35 of file ConvertFullyConnectedWeights.cpp.

References arm_compute::CHANNEL, arm_compute::coords2index(), SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, arm_compute::index2coords(), arm_compute::NCHW, arm_compute::NHWC, SimpleTensor< T >::num_elements(), SimpleTensor< T >::shape(), arm_compute::test::validation::src, arm_compute::WIDTH, Dimensions< T >::x(), and Dimensions< T >::y().

36 {
37  SimpleTensor<T> dst(src.shape(), src.data_type());
38 
39  const DataLayout original_input_data_layout = (training_data_layout == DataLayout::NCHW) ? DataLayout::NHWC : DataLayout::NCHW;
40 
41  const int width_idx = get_data_layout_dimension_index(original_input_data_layout, DataLayoutDimension::WIDTH);
42  const int height_idx = get_data_layout_dimension_index(original_input_data_layout, DataLayoutDimension::HEIGHT);
43  const int channel_idx = get_data_layout_dimension_index(original_input_data_layout, DataLayoutDimension::CHANNEL);
44 
45  const bool is_nchw_to_nhwc = training_data_layout == DataLayout::NCHW;
46  const unsigned int num_elems_per_input_plane = original_input_shape[width_idx] * original_input_shape[height_idx];
47  const unsigned int num_channels = original_input_shape[channel_idx];
48  const unsigned int factor_1 = is_nchw_to_nhwc ? num_elems_per_input_plane : num_channels;
49  const unsigned int factor_2 = is_nchw_to_nhwc ? num_channels : num_elems_per_input_plane;
50 
51  const uint32_t num_elements = src.num_elements();
52 #if defined(_OPENMP)
53  #pragma omp parallel for
54 #endif /* _OPENMP */
55  for(uint32_t i = 0; i < num_elements; ++i)
56  {
57  const Coordinates coords_in = index2coords(src.shape(), i);
58  const Coordinates coords_out(coords_in.x(), coords_in.y() % factor_1 * factor_2 + coords_in.y() / factor_1);
59 
60  dst[coords2index(dst.shape(), coords_out)] = src[i];
61  }
62 
63  return dst;
64 }
Coordinates index2coords(const TensorShape &shape, int index)
Convert a linear index into n-dimensional coordinates.
Definition: Helpers.inl:156
SimpleTensor< float > src
Definition: DFT.cpp:155
int coords2index(const TensorShape &shape, const Coordinates &coord)
Convert n-dimensional coordinates into a linear index.
Definition: Helpers.inl:175
size_t get_data_layout_dimension_index(const DataLayout data_layout, const DataLayoutDimension data_layout_dimension)
Get the index of the given dimension.
Definition: Helpers.inl:193
DataLayout
[DataLayout enum definition]
Definition: Types.h:111

◆ convert_fully_connected_weights() [2/4]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::convert_fully_connected_weights ( const SimpleTensor< uint8_t > &  src,
const TensorShape original_input_shape,
const DataLayout  training_data_layout 
)

◆ convert_fully_connected_weights() [3/4]

template SimpleTensor<half> arm_compute::test::validation::reference::convert_fully_connected_weights ( const SimpleTensor< half > &  src,
const TensorShape original_input_shape,
const DataLayout  training_data_layout 
)

◆ convert_fully_connected_weights() [4/4]

template SimpleTensor<float> arm_compute::test::validation::reference::convert_fully_connected_weights ( const SimpleTensor< float > &  src,
const TensorShape original_input_shape,
const DataLayout  training_data_layout 
)

◆ convolution_layer() [1/6]

SimpleTensor< T > convolution_layer ( const SimpleTensor< T > &  src,
const SimpleTensor< TW > &  weights,
const SimpleTensor< TB > &  bias,
const TensorShape output_shape,
const PadStrideInfo info,
const Size2D dilation,
unsigned int  num_groups,
QuantizationInfo  out_quant_info 
)

Definition at line 111 of file ConvolutionLayer.cpp.

References convolution_layer_nchw(), SimpleTensor< T >::data_type(), arm_compute::test::validation::dst, arm_compute::test::validation::info, arm_compute::test::validation::num_groups, arm_compute::test::validation::output_shape, SimpleTensor< T >::quantization_info(), and arm_compute::test::validation::src.

Referenced by deconvolution_layer().

113 {
114  // if no explicit quantization has been set you the same as src
115  if(out_quant_info == QuantizationInfo())
116  {
117  out_quant_info = src.quantization_info();
118  }
119  // Create reference
120  SimpleTensor<T> dst{ output_shape, src.data_type(), 1, out_quant_info };
121 
122  return convolution_layer_nchw(src, weights, bias, dst, info, dilation, num_groups);
123 }
SimpleTensor< float > src
Definition: DFT.cpp:155
const unsigned int num_groups
Definition: Im2Col.cpp:153
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
SimpleTensor< T > convolution_layer_nchw(const SimpleTensor< T > &src, const SimpleTensor< TW > &weights, const SimpleTensor< TB > &bias, SimpleTensor< T > &dst, const PadStrideInfo &info, const Size2D &dilation, unsigned int num_groups)

◆ convolution_layer() [2/6]

template SimpleTensor<float> arm_compute::test::validation::reference::convolution_layer ( const SimpleTensor< float > &  src,
const SimpleTensor< float > &  weights,
const SimpleTensor< float > &  bias,
const TensorShape output_shape,
const PadStrideInfo info,
const Size2D dilation,
unsigned int  num_groups,
QuantizationInfo  out_quant_info 
)

◆ convolution_layer() [3/6]

template SimpleTensor<half> arm_compute::test::validation::reference::convolution_layer ( const SimpleTensor< half > &  src,
const SimpleTensor< half > &  weights,
const SimpleTensor< half > &  bias,
const TensorShape output_shape,
const PadStrideInfo info,
const Size2D dilation,
unsigned int  num_groups,
QuantizationInfo  out_quant_info 
)

◆ convolution_layer() [4/6]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::convolution_layer ( const SimpleTensor< uint8_t > &  src,
const SimpleTensor< uint8_t > &  weights,
const SimpleTensor< int32_t > &  bias,
const TensorShape output_shape,
const PadStrideInfo info,
const Size2D dilation,
unsigned int  num_groups,
QuantizationInfo  out_quant_info 
)

◆ convolution_layer() [5/6]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::convolution_layer ( const SimpleTensor< uint8_t > &  src,
const SimpleTensor< int8_t > &  weights,
const SimpleTensor< int32_t > &  bias,
const TensorShape output_shape,
const PadStrideInfo info,
const Size2D dilation,
unsigned int  num_groups,
QuantizationInfo  out_quant_info 
)

◆ convolution_layer() [6/6]

template SimpleTensor<int8_t> arm_compute::test::validation::reference::convolution_layer ( const SimpleTensor< int8_t > &  src,
const SimpleTensor< int8_t > &  weights,
const SimpleTensor< int32_t > &  bias,
const TensorShape output_shape,
const PadStrideInfo info,
const Size2D dilation,
unsigned int  num_groups,
QuantizationInfo  out_quant_info 
)

◆ convolution_layer_nchw()

SimpleTensor<T> arm_compute::test::validation::reference::convolution_layer_nchw ( const SimpleTensor< T > &  src,
const SimpleTensor< TW > &  weights,
const SimpleTensor< TB > &  bias,
SimpleTensor< T > &  dst,
const PadStrideInfo info,
const Size2D dilation,
unsigned int  num_groups 
)

Definition at line 45 of file ConvolutionLayer.cpp.

References ARM_COMPUTE_ASSERT, ARM_COMPUTE_ERROR_ON, arm_compute::test::convolution_3d::detail::convolution3d(), arm_compute::test::validation::dst, arm_compute::test::validation::num_groups, arm_compute::test::validation::output_wh, PadStrideInfo::pad_left(), PadStrideInfo::pad_top(), arm_compute::scaled_dimensions(), SimpleTensor< T >::shape(), PadStrideInfo::stride(), Size2D::x(), and Size2D::y().

Referenced by convolution_layer().

47 {
48  ARM_COMPUTE_ERROR_ON((src.shape()[2] / num_groups) != weights.shape()[2]);
49 
50  // Compute reference
51  const int width_in = src.shape().x();
52  const int height_in = src.shape().y();
53  const int depth_in = src.shape().z();
54  const int width_out = dst.shape().x();
55  const int height_out = dst.shape().y();
56  const int depth_out = dst.shape().z();
57  const int width_weights = weights.shape().x();
58  const int height_weights = weights.shape().y();
59  const int depth_weights = weights.shape().z();
60  const int pad_left = info.pad_left();
61  const int pad_top = info.pad_top();
62  const int stride_xi = info.stride().first;
63  const int stride_yi = info.stride().second;
64 
65  auto output_wh = scaled_dimensions(width_in, height_in, width_weights, height_weights, info, dilation);
66 
67  const int start_xi = (dilation.x() * (width_weights - 1) + 1) / 2 - pad_left;
68  const int start_yi = (dilation.y() * (height_weights - 1) + 1) / 2 - pad_top;
69  const int end_xi = output_wh.first * stride_xi;
70  const int end_yi = output_wh.second * stride_yi;
71  const int num_batches = src.shape().total_size() / (width_in * height_in * depth_in);
72 
73 #if defined(_OPENMP) && !( defined(__arm__) && defined(__ANDROID__))
74  #pragma omp parallel for collapse(5)
75 #endif /* _OPENMP */
76  for(int r = 0; r < num_batches; ++r)
77  {
78  for(int yi = start_yi; yi < start_yi + end_yi; yi += stride_yi)
79  {
80  for(int xi = start_xi; xi < start_xi + end_xi; xi += stride_xi)
81  {
82  for(int group = 0; group < static_cast<int>(num_groups); ++group)
83  {
84  for(int ofm = 0; ofm < static_cast<int>(depth_out / num_groups); ++ofm)
85  {
86  // Compute input and output offsets
87  const int offset_in = r * width_in * height_in * depth_in + (group * (depth_in / num_groups) * width_in * height_in);
88  const int xo = (xi - start_xi) / stride_xi;
89  const int yo = (yi - start_yi) / stride_yi;
90  const int offset_out = xo + yo * width_out + ((ofm + group * (depth_out / num_groups)) * width_out * height_out) + (r * width_out * height_out * depth_out);
91  const int offset_w = (ofm + group * (depth_out / num_groups)) * width_weights * height_weights * depth_weights;
92  const int offset_b = (ofm + group * (depth_out / num_groups));
93 
94  ARM_COMPUTE_ASSERT(xo < width_out);
95  ARM_COMPUTE_ASSERT(yo < height_out);
96 
97  // Compute 3D convolution
99  offset_in, offset_w, offset_b, offset_out,
100  xi, yi,
101  width_in, height_in, (depth_in / num_groups),
102  width_weights, height_weights, dilation.x(), dilation.y(), ofm);
103  }
104  }
105  }
106  }
107  }
108  return dst;
109 }
#define ARM_COMPUTE_ASSERT(cond)
Definition: Validate.h:37
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
SimpleTensor< float > src
Definition: DFT.cpp:155
std::pair< unsigned int, unsigned int > scaled_dimensions(int width, int height, int kernel_width, int kernel_height, const PadStrideInfo &pad_stride_info, const Size2D &dilation=Size2D(1U, 1U))
Returns expected width and height of output scaled tensor depending on dimensions rounding mode...
Definition: Utils.cpp:395
void convolution3d(const SimpleTensor< T > &in, const SimpleTensor< TW > &weights, const SimpleTensor< TB > &bias, SimpleTensor< T > &out, int i_offset, int w_offset, int b_offset, int o_offset, int xi, int yi, int width_in, int height_in, int depth_in, int width_weights, int height_weights, int dilation_x=1, int dilation_y=1, int filter_id=0)
Definition: Convolution3d.h:49
const unsigned int num_groups
Definition: Im2Col.cpp:153
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)

◆ copy() [1/9]

◆ copy() [2/9]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::copy ( const SimpleTensor< uint8_t > &  src,
const TensorShape output_shape 
)

◆ copy() [3/9]

template SimpleTensor<int8_t> arm_compute::test::validation::reference::copy ( const SimpleTensor< int8_t > &  src,
const TensorShape output_shape 
)

◆ copy() [4/9]

template SimpleTensor<uint16_t> arm_compute::test::validation::reference::copy ( const SimpleTensor< uint16_t > &  src,
const TensorShape output_shape 
)

◆ copy() [5/9]

template SimpleTensor<int16_t> arm_compute::test::validation::reference::copy ( const SimpleTensor< int16_t > &  src,
const TensorShape output_shape 
)

◆ copy() [6/9]

template SimpleTensor<uint32_t> arm_compute::test::validation::reference::copy ( const SimpleTensor< uint32_t > &  src,
const TensorShape output_shape 
)

◆ copy() [7/9]

template SimpleTensor<int32_t> arm_compute::test::validation::reference::copy ( const SimpleTensor< int32_t > &  src,
const TensorShape output_shape 
)

◆ copy() [8/9]

template SimpleTensor<half> arm_compute::test::validation::reference::copy ( const SimpleTensor< half > &  src,
const TensorShape output_shape 
)

◆ copy() [9/9]

template SimpleTensor<float> arm_compute::test::validation::reference::copy ( const SimpleTensor< float > &  src,
const TensorShape output_shape 
)

◆ crop_and_resize() [1/8]

SimpleTensor< float > crop_and_resize ( const SimpleTensor< T > &  src,
const SimpleTensor< float > &  boxes,
SimpleTensor< int32_t >  box_ind,
Coordinates2D  crop_size,
InterpolationPolicy  method,
float  extrapolation_value 
)

Definition at line 160 of file CropResize.cpp.

References ARM_COMPUTE_ERROR_ON, SimpleTensor< T >::data(), SimpleTensor< T >::data_layout(), arm_compute::F32, arm_compute::NHWC, SimpleTensor< T >::num_elements(), SimpleTensor< T >::shape(), Coordinates2D::x, and Coordinates2D::y.

162 {
163  ARM_COMPUTE_ERROR_ON(src.shape().num_dimensions() > 4);
164  ARM_COMPUTE_ERROR_ON(src.data_layout() != DataLayout::NHWC);
165 
166  const TensorShape out_shape(src.shape()[0], crop_size.x, crop_size.y, boxes.shape()[1]);
167  SimpleTensor<float> out{ out_shape, DataType::F32, 1, QuantizationInfo(), DataLayout::NHWC };
168 
169  const TensorShape scaled_image_shape(src.shape()[0], crop_size.x, crop_size.y);
170 
171  for(uint32_t i = 0; i < boxes.shape()[1]; ++i)
172  {
173  Coordinates start = Coordinates(std::floor((*reinterpret_cast<const float *>(boxes(Coordinates(1, i)))) * (src.shape()[1] - 1) + 0.5f),
174  std::floor((*reinterpret_cast<const float *>(boxes(Coordinates(0, i)))) * (src.shape()[2] - 1) + 0.5f));
175  Coordinates end = Coordinates(std::floor((*reinterpret_cast<const float *>(boxes(Coordinates(3, i)))) * (src.shape()[1] - 1) + 0.5f),
176  std::floor((*reinterpret_cast<const float *>(boxes(Coordinates(2, i)))) * (src.shape()[2] - 1) + 0.5f));
177  SimpleTensor<float> cropped = crop_image(src, start, end, box_ind[i], extrapolation_value);
178  SimpleTensor<float> scaled = scale_image(cropped, scaled_image_shape, method, extrapolation_value);
179  std::copy_n(reinterpret_cast<float *>(scaled.data()), scaled.num_elements(), reinterpret_cast<float *>(out(Coordinates(0, 0, 0, i))));
180  }
181  return out;
182 }
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
SimpleTensor< float > src
Definition: DFT.cpp:155
void end(TokenStream &in, bool &valid)
Definition: MLGOParser.cpp:290
int x
The x coordinate.
Definition: types.h:30
int y
The y coordinate.
Definition: types.h:31

◆ crop_and_resize() [2/8]

template SimpleTensor<float> arm_compute::test::validation::reference::crop_and_resize ( const SimpleTensor< float > &  src,
const SimpleTensor< float > &  boxes,
SimpleTensor< int32_t >  box_ind,
Coordinates2D  crop_size,
InterpolationPolicy  method,
float  extrapolation_value 
)

◆ crop_and_resize() [3/8]

template SimpleTensor<float> arm_compute::test::validation::reference::crop_and_resize ( const SimpleTensor< uint16_t > &  src,
const SimpleTensor< float > &  boxes,
SimpleTensor< int32_t >  box_ind,
Coordinates2D  crop_size,
InterpolationPolicy  method,
float  extrapolation_value 
)

◆ crop_and_resize() [4/8]

template SimpleTensor<float> arm_compute::test::validation::reference::crop_and_resize ( const SimpleTensor< uint32_t > &  src,
const SimpleTensor< float > &  boxes,
SimpleTensor< int32_t >  box_ind,
Coordinates2D  crop_size,
InterpolationPolicy  method,
float  extrapolation_value 
)

◆ crop_and_resize() [5/8]

template SimpleTensor<float> arm_compute::test::validation::reference::crop_and_resize ( const SimpleTensor< int16_t > &  src,
const SimpleTensor< float > &  boxes,
SimpleTensor< int32_t >  box_ind,
Coordinates2D  crop_size,
InterpolationPolicy  method,
float  extrapolation_value 
)

◆ crop_and_resize() [6/8]

template SimpleTensor<float> arm_compute::test::validation::reference::crop_and_resize ( const SimpleTensor< int32_t > &  src,
const SimpleTensor< float > &  boxes,
SimpleTensor< int32_t >  box_ind,
Coordinates2D  crop_size,
InterpolationPolicy  method,
float  extrapolation_value 
)

◆ crop_and_resize() [7/8]

template SimpleTensor<float> arm_compute::test::validation::reference::crop_and_resize ( const SimpleTensor< half > &  src,
const SimpleTensor< float > &  boxes,
SimpleTensor< int32_t >  box_ind,
Coordinates2D  crop_size,
InterpolationPolicy  method,
float  extrapolation_value 
)

◆ crop_and_resize() [8/8]

template SimpleTensor<float> arm_compute::test::validation::reference::crop_and_resize ( const SimpleTensor< uint8_t > &  src,
const SimpleTensor< float > &  boxes,
SimpleTensor< int32_t >  box_ind,
Coordinates2D  crop_size,
InterpolationPolicy  method,
float  extrapolation_value 
)

◆ deconvolution_layer() [1/6]

SimpleTensor< T > deconvolution_layer ( const SimpleTensor< T > &  src,
const SimpleTensor< TW > &  weights,
const SimpleTensor< TB > &  bias,
const TensorShape output_shape,
const PadStrideInfo info,
QuantizationInfo  out_qinfo = QuantizationInfo() 
)

Deconvolution reference implementation.

src Input tensor. 3 lower dimensions represent a single input, and an optional 4th dimension for batch of inputs. Data types supported: QASYMM8/QASYMM8_SIGNED/F32/F16. weights The 4d weights with dimensions [width, height, OFM, IFM]. Data type supported: Same as input, also could be QSYMM8_PER_CHANNEL if input is QASYMM8/QASYMM8_SIGNED. bias Optional, ignored if NULL. The biases have one dimension. Data type supported: Same as input, except for input of QASYMM8/QASYMM8_SIGNED types where biases should be of S32 type output_shape Output tensor shape. The output has the same number of dimensions as the input. info Contains padding and policies to be used in the deconvolution, this is decribed in PadStrideInfo. a The number of zeros added to right and top edges of the input.

Definition at line 37 of file DeconvolutionLayer.cpp.

References ARM_COMPUTE_ERROR_ON, arm_compute::CEIL, arm_compute::test::validation::conv_info, convolution_layer(), SimpleTensor< T >::data(), SimpleTensor< T >::data_layout(), SimpleTensor< T >::data_type(), arm_compute::test::validation::info, offset(), arm_compute::test::validation::output_shape, PadStrideInfo::pad_bottom(), PadStrideInfo::pad_left(), PadStrideInfo::pad_right(), PadStrideInfo::pad_top(), arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, SimpleTensor< T >::quantization_info(), TensorShape::set(), SimpleTensor< T >::shape(), slice(), arm_compute::test::validation::src, PadStrideInfo::stride(), arm_compute::utils::cast::U, weights_height, weights_width, Dimensions< T >::x(), and Dimensions< T >::y().

39 {
40  // Create reference
41  const unsigned int pad_left = info.pad_left();
42  const unsigned int pad_right = info.pad_right();
43  const unsigned int pad_top = info.pad_top();
44  const unsigned int pad_bottom = info.pad_bottom();
45  const int stride_x = info.stride().first;
46  const int stride_y = info.stride().second;
47  const int weights_width = weights.shape().x();
48  const int weights_height = weights.shape().y();
49  const int weights_upper_dims = weights.shape().total_size() / (weights_width * weights_height);
50 
51  ARM_COMPUTE_ERROR_ON(pad_left > (weights.shape().x() - 1));
52  ARM_COMPUTE_ERROR_ON(pad_right > (weights.shape().x() - 1));
53  ARM_COMPUTE_ERROR_ON(pad_top > (weights.shape().y() - 1));
54  ARM_COMPUTE_ERROR_ON(pad_bottom > (weights.shape().y() - 1));
55 
56  // Find the upsampled dimensions
57  unsigned int out_x = (src.shape().x() - 1) * stride_x + 1;
58  unsigned int out_y = (src.shape().y() - 1) * stride_y + 1;
59 
60  // Find the padding needed for the convolution with stride 1 in order to match output shape
61  unsigned int deconv_pad_x = output_shape.x() - (out_x - weights_width + 1);
62  unsigned int deconv_pad_y = output_shape.y() - (out_y - weights_height + 1);
63  out_x += deconv_pad_x;
64  out_y += deconv_pad_y;
65 
66  unsigned int deconv_pad_left = pad_right > pad_left ? pad_right - pad_left : 0;
67  unsigned int deconv_pad_right = pad_left > pad_right ? pad_left - pad_right : 0;
68  deconv_pad_x -= deconv_pad_left + deconv_pad_right;
69  ARM_COMPUTE_ERROR_ON((deconv_pad_x % 2) != 0);
70  deconv_pad_left += deconv_pad_x / 2;
71  deconv_pad_right += deconv_pad_x / 2;
72 
73  unsigned int deconv_pad_top = pad_bottom > pad_top ? pad_bottom - pad_top : 0;
74  unsigned int deconv_pad_bottom = pad_top > pad_bottom ? pad_top - pad_bottom : 0;
75  deconv_pad_y -= deconv_pad_top + deconv_pad_bottom;
76  ARM_COMPUTE_ERROR_ON((deconv_pad_y % 2) != 0);
77  deconv_pad_top += deconv_pad_y / 2;
78  deconv_pad_bottom += deconv_pad_y / 2;
79 
80  TensorShape scaled_shape = src.shape();
81  scaled_shape.set(0, out_x);
82  scaled_shape.set(1, out_y);
83  SimpleTensor<T> scaled{ scaled_shape, src.data_type(), 1, src.quantization_info() };
84 
85  const int width_in = src.shape().x();
86  const int height_in = src.shape().y();
87  const int width_scaled = scaled.shape().x();
88  const int height_scaled = scaled.shape().y();
89  const int num_2d_slices = src.shape().total_size() / (width_in * height_in);
90 
91  if(src.data_type() == DataType::QASYMM8 || src.data_type() == DataType::QASYMM8_SIGNED)
92  {
93  const auto quantized_zero = static_cast<T>(src.quantization_info().uniform().offset);
94  std::fill_n(scaled.data(), scaled.num_elements(), quantized_zero);
95  }
96  else
97  {
98  std::fill_n(scaled.data(), scaled.num_elements(), T(0));
99  }
100 
101  // Flip weights by 180 degrees
102  SimpleTensor<TW> weights_flipped{ weights.shape(), weights.data_type(), 1, weights.quantization_info(), weights.data_layout() };
103 #if defined(_OPENMP)
104  #pragma omp parallel for
105 #endif /* _OPENMP */
106  for(int ud = 0; ud < weights_upper_dims; ++ud)
107  {
108  const int offset = ud * weights_width * weights_height;
109  for(int y = 0; y < weights_height; ++y)
110  {
111  for(int x = 0; x < weights_width; ++x)
112  {
113  weights_flipped[offset + (weights_height - 1 - y) * weights_width + (weights_width - 1 - x)] = weights[offset + y * weights_width + x];
114  }
115  }
116  }
117 #if defined(_OPENMP)
118  #pragma omp parallel for
119 #endif /* _OPENMP */
120  for(int slice = 0; slice < num_2d_slices; ++slice)
121  {
122  const int offset_slice_in = slice * width_in * height_in;
123  const int offset_slice_out = slice * width_scaled * height_scaled;
124  const int start_x = deconv_pad_left;
125  const int start_y = deconv_pad_top;
126  const int end_x = width_scaled - deconv_pad_right;
127  const int end_y = height_scaled - deconv_pad_bottom;
128 
129  for(int yi = start_y, in_y = 0; yi < end_y; yi += stride_y, in_y++)
130  {
131  for(int xi = start_x, in_x = 0; xi < end_x; xi += stride_x, in_x++)
132  {
133  const T *in = src.data() + offset_slice_in + in_y * width_in + in_x;
134  T *out = scaled.data() + offset_slice_out + xi + yi * width_scaled;
135  *out = *in;
136  }
137  }
138  }
139 
140  const PadStrideInfo conv_info(1, 1, 0, 0, 0, 0, DimensionRoundingType::CEIL);
141  return convolution_layer(scaled, weights_flipped, bias, output_shape, conv_info, Size2D(1U, 1U), 1, out_qinfo);
142 }
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
Definition: helpers.h:861
const size_t weights_height
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:466
SimpleTensor< float > src
Definition: DFT.cpp:155
T x() const
Alias to access the size of the first dimension.
Definition: Dimensions.h:87
const size_t weights_width
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
SimpleTensor< T > convolution_layer(const SimpleTensor< T > &src, const SimpleTensor< TW > &weights, const SimpleTensor< TB > &bias, const TensorShape &output_shape, const PadStrideInfo &info, const Size2D &dilation, unsigned int num_groups, QuantizationInfo out_quant_info)
T y() const
Alias to access the size of the second dimension.
Definition: Dimensions.h:92
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)

◆ deconvolution_layer() [2/6]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::deconvolution_layer ( const SimpleTensor< uint8_t > &  src,
const SimpleTensor< uint8_t > &  weights,
const SimpleTensor< int32_t > &  bias,
const TensorShape output_shape,
const PadStrideInfo info,
QuantizationInfo  out_quant_info 
)

◆ deconvolution_layer() [3/6]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::deconvolution_layer ( const SimpleTensor< uint8_t > &  src,
const SimpleTensor< int8_t > &  weights,
const SimpleTensor< int32_t > &  bias,
const TensorShape output_shape,
const PadStrideInfo info,
QuantizationInfo  out_quant_info 
)

◆ deconvolution_layer() [4/6]

template SimpleTensor<int8_t> arm_compute::test::validation::reference::deconvolution_layer ( const SimpleTensor< int8_t > &  src,
const SimpleTensor< int8_t > &  weights,
const SimpleTensor< int32_t > &  bias,
const TensorShape output_shape,
const PadStrideInfo info,
QuantizationInfo  out_quant_info 
)

◆ deconvolution_layer() [5/6]

template SimpleTensor<float> arm_compute::test::validation::reference::deconvolution_layer ( const SimpleTensor< float > &  src,
const SimpleTensor< float > &  weights,
const SimpleTensor< float > &  bias,
const TensorShape output_shape,
const PadStrideInfo info,
QuantizationInfo  out_quant_info 
)

◆ deconvolution_layer() [6/6]

template SimpleTensor<half> arm_compute::test::validation::reference::deconvolution_layer ( const SimpleTensor< half > &  src,
const SimpleTensor< half > &  weights,
const SimpleTensor< half > &  bias,
const TensorShape output_shape,
const PadStrideInfo info,
QuantizationInfo  out_quant_info 
)

◆ depth_convert() [1/10]

SimpleTensor< T2 > depth_convert ( const SimpleTensor< T1 > &  src,
DataType  dt_out,
ConvertPolicy  policy,
uint32_t  shift 
)

Definition at line 42 of file DepthConvertLayer.cpp.

References ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_UNUSED, SimpleTensor< T >::data_type(), arm_compute::element_size_from_data_type(), SimpleTensor< T >::num_elements(), arm_compute::utils::rounding::round_half_away_from_zero(), arm_compute::SATURATE, arm_compute::utils::cast::saturate_cast(), SimpleTensor< T >::shape(), arm_compute::test::validation::src, and type.

43 {
44  SimpleTensor<T2> result(src.shape(), dt_out);
45 
46  // Up-casting
48  {
49 #if defined(_OPENMP)
50  #pragma omp parallel for
51 #endif /* _OPENMP */
52  for(int i = 0; i < src.num_elements(); ++i)
53  {
54  result[i] = src[i] << shift;
55  }
56  }
57  // Down-casting
58  else
59  {
60 #if defined(_OPENMP)
61  #pragma omp parallel for
62 #endif /* _OPENMP */
63  for(int i = 0; i < src.num_elements(); ++i)
64  {
65  T1 val = src[i] >> shift;
66  result[i] = (policy == ConvertPolicy::SATURATE) ? utils::cast::saturate_cast<T2>(val) : static_cast<T2>(val);
67  }
68  }
69  return result;
70 }
size_t element_size_from_data_type(DataType dt)
The size in bytes of the data type.
Definition: Utils.h:185
SimpleTensor< float > src
Definition: DFT.cpp:155

◆ depth_convert() [2/10]

template SimpleTensor< float > depth_convert ( const SimpleTensor< uint8_t > &  src,
DataType  dt_out,
ConvertPolicy  policy,
uint32_t  shift 
)

◆ depth_convert() [3/10]

template SimpleTensor< float > depth_convert ( const SimpleTensor< int8_t > &  src,
DataType  dt_out,
ConvertPolicy  policy,
uint32_t  shift 
)

◆ depth_convert() [4/10]

template SimpleTensor< float > depth_convert ( const SimpleTensor< uint16_t > &  src,
DataType  dt_out,
ConvertPolicy  policy,
uint32_t  shift 
)

◆ depth_convert() [5/10]

template SimpleTensor< float > depth_convert ( const SimpleTensor< int16_t > &  src,
DataType  dt_out,
ConvertPolicy  policy,
uint32_t  shift 
)

◆ depth_convert() [6/10]

template SimpleTensor< float > depth_convert ( const SimpleTensor< uint32_t > &  src,
DataType  d