Compute Library
 20.05
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< 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< 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 > box3x3 (const SimpleTensor< T > &src, BorderMode border_mode, T constant_border_value)
 
template SimpleTensor< uint8_t > box3x3 (const SimpleTensor< uint8_t > &src, BorderMode border_mode, uint8_t constant_border_value)
 
template<typename T >
SimpleTensor< T > canny_edge_detector (const SimpleTensor< T > &src, int32_t upper_thresh, int32_t lower_thresh, int gradient_size, MagnitudeType norm_type, BorderMode border_mode, T constant_border_value)
 
template SimpleTensor< uint8_t > canny_edge_detector (const SimpleTensor< uint8_t > &src, int32_t upper_thresh, int32_t lower_thresh, int gradient_size, MagnitudeType norm_type, BorderMode border_mode, uint8_t constant_border_value)
 
template<typename T >
std::vector< SimpleTensor< T > > channel_combine (const TensorShape &shape, const std::vector< SimpleTensor< T >> &image_planes, Format format)
 
template std::vector< SimpleTensor< uint8_t > > channel_combine (const TensorShape &shape, const std::vector< SimpleTensor< uint8_t >> &image_planes, Format format)
 
template<typename T >
SimpleTensor< uint8_t > channel_extract (const TensorShape &shape, const std::vector< SimpleTensor< T >> &tensor_planes, Format format, Channel channel)
 
template SimpleTensor< uint8_t > channel_extract (const TensorShape &shape, const std::vector< SimpleTensor< uint8_t >> &tensor_planes, Format format, Channel channel)
 
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 >
std::vector< SimpleTensor< T > > color_convert (const TensorShape &shape, const std::vector< SimpleTensor< T >> &tensor_planes, Format src_format, Format dst_format)
 
template std::vector< SimpleTensor< uint8_t > > color_convert (const TensorShape &shape, const std::vector< SimpleTensor< uint8_t >> &tensor_planes, Format src_format, Format dst_format)
 
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 >
SimpleTensor< T > convolution (const SimpleTensor< uint8_t > &src, DataType output_data_type, const int16_t *conv, uint32_t scale, BorderMode border_mode, uint8_t constant_border_value, const unsigned int width, const unsigned int height)
 
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<typename T , typename TB >
SimpleTensor< T > deconvolution_layer (const SimpleTensor< T > &src, const SimpleTensor< T > &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< 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 , typename U >
std::pair< SimpleTensor< T >, SimpleTensor< T > > derivative (const SimpleTensor< U > &src, BorderMode border_mode, uint8_t constant_border_value, GradientDimension gradient_dimension)
 
template std::pair< SimpleTensor< int16_t >, SimpleTensor< int16_t > > derivative (const SimpleTensor< uint8_t > &src, BorderMode border_mode, uint8_t constant_border_value, GradientDimension gradient_dimension)
 
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<typename T >
SimpleTensor< T > dilate (const SimpleTensor< T > &src, BorderMode border_mode, T constant_border_value)
 
template SimpleTensor< uint8_t > dilate (const SimpleTensor< uint8_t > &src, BorderMode border_mode, uint8_t constant_border_value)
 
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< int32_t > arithmetic_operation (ArithmeticOperation op, const SimpleTensor< int32_t > &src1, const SimpleTensor< int32_t > &src2, DataType dst_data_type, ConvertPolicy convert_policy)
 
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 > equalize_histogram (const SimpleTensor< T > &src)
 
template SimpleTensor< uint8_t > equalize_histogram (const SimpleTensor< uint8_t > &src)
 
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 >
std::vector< KeyPointfast_corners (const SimpleTensor< T > &src, float input_thresh, bool suppress_nonmax, BorderMode border_mode, T constant_border_value)
 
template std::vector< KeyPointfast_corners (const SimpleTensor< uint8_t > &src, float threshold, bool suppress_nonmax, 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 >
SimpleTensor< T > gaussian3x3 (const SimpleTensor< T > &src, BorderMode border_mode, T constant_border_value)
 
template SimpleTensor< uint8_t > gaussian3x3 (const SimpleTensor< uint8_t > &src, BorderMode border_mode, uint8_t constant_border_value)
 
template<typename T >
SimpleTensor< T > gaussian5x5 (const SimpleTensor< T > &src, BorderMode border_mode, T constant_border_value)
 
template SimpleTensor< uint8_t > gaussian5x5 (const SimpleTensor< uint8_t > &src, BorderMode border_mode, uint8_t constant_border_value)
 
template<typename T >
std::vector< SimpleTensor< T > > gaussian_pyramid_half (const SimpleTensor< T > &src, BorderMode border_mode, uint8_t constant_border_value, size_t num_levels)
 
template std::vector< SimpleTensor< uint8_t > > gaussian_pyramid_half (const SimpleTensor< uint8_t > &src, BorderMode border_mode, uint8_t constant_border_value, size_t num_levels)
 
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 >
std::vector< KeyPointharris_corner_detector (const SimpleTensor< T > &src, float threshold, float min_dist, float sensitivity, int gradient_size, int block_size, BorderMode border_mode, T constant_border_value)
 
template std::vector< KeyPointharris_corner_detector (const SimpleTensor< uint8_t > &src, float threshold, float min_dist, float sensitivity, int gradient_size, int block_size, BorderMode border_mode, uint8_t constant_border_value)
 
template<typename T >
SimpleTensor< uint32_t > histogram (const SimpleTensor< T > &src, size_t num_bins, int32_t offset, uint32_t range)
 
template SimpleTensor< uint32_t > histogram (const SimpleTensor< uint8_t > &src, size_t num_bins, int32_t offset, uint32_t range)
 
template<typename T , typename U , typename V >
void hog_orientation_binning (const SimpleTensor< T > &mag, const SimpleTensor< U > &phase, SimpleTensor< V > &hog_space, const HOGInfo &hog_info)
 
template<typename T >
void hog_block_normalization (SimpleTensor< T > &desc, const SimpleTensor< T > &hog_space, const HOGInfo &hog_info)
 
template<typename T , typename U >
SimpleTensor< T > hog_descriptor (const SimpleTensor< U > &src, BorderMode border_mode, U constant_border_value, const HOGInfo &hog_info)
 
template void hog_orientation_binning (const SimpleTensor< int16_t > &mag, const SimpleTensor< uint8_t > &phase, SimpleTensor< float > &hog_space, const HOGInfo &hog_info)
 
template void hog_block_normalization (SimpleTensor< float > &desc, const SimpleTensor< float > &hog_space, const HOGInfo &hog_info)
 
template SimpleTensor< float > hog_descriptor (const SimpleTensor< uint8_t > &src, BorderMode border_mode, uint8_t constant_border_value, const HOGInfo &hog_info)
 
template<typename T >
std::vector< DetectionWindowhog_detector (const SimpleTensor< T > &src, const std::vector< T > &descriptor, unsigned int max_num_detection_windows, const HOGInfo &hog_info, const Size2D &detection_window_stride, float threshold, uint16_t idx_class)
 
template std::vector< DetectionWindowhog_detector (const SimpleTensor< float > &src, const std::vector< float > &descriptor, unsigned int max_num_detection_windows, const HOGInfo &hog_info, const Size2D &detection_window_stride, float threshold, uint16_t idx_class)
 
void detection_windows_non_maxima_suppression (std::vector< DetectionWindow > &multi_windows, float min_distance)
 
template<typename T >
std::vector< DetectionWindowhog_multi_detection (const SimpleTensor< T > &src, BorderMode border_mode, T constant_border_value, const std::vector< HOGInfo > &models, std::vector< std::vector< float >> descriptors, unsigned int max_num_detection_windows, float threshold, bool non_maxima_suppression, float min_distance)
 
template std::vector< DetectionWindowhog_multi_detection (const SimpleTensor< uint8_t > &src, BorderMode border_mode, uint8_t constant_border_value, const std::vector< HOGInfo > &models, std::vector< std::vector< float >> descriptors, unsigned int max_num_detection_windows, float threshold, bool non_maxima_suppression, float min_distance)
 
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< uint32_t > integral_image (const SimpleTensor< T > &src)
 
template SimpleTensor< uint32_t > integral_image (const SimpleTensor< uint8_t > &src)
 
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 , typename U >
std::vector< SimpleTensor< U > > laplacian_pyramid (const SimpleTensor< T > &src, SimpleTensor< U > &dst, size_t num_levels, BorderMode border_mode, uint8_t constant_border_value)
 
template std::vector< SimpleTensor< int16_t > > laplacian_pyramid (const SimpleTensor< uint8_t > &src, SimpleTensor< int16_t > &dst, size_t num_levels, BorderMode border_mode, uint8_t constant_border_value)
 
template<typename T , typename U >
SimpleTensor< U > laplacian_reconstruct (const std::vector< SimpleTensor< T >> &pyramid, const SimpleTensor< T > &low_res, BorderMode border_mode, T constant_border_value)
 
template SimpleTensor< uint8_t > laplacian_reconstruct (const std::vector< SimpleTensor< int16_t >> &pyramid, const SimpleTensor< int16_t > &low_res, BorderMode border_mode, int16_t constant_border_value)
 
template<typename T , typename TB >
SimpleTensor< T > locally_connected (const SimpleTensor< T > &src, const SimpleTensor< T > &weights, const SimpleTensor< TB > &bias, const TensorShape &output_shape, const PadStrideInfo &info)
 
template SimpleTensor< float > locally_connected (const SimpleTensor< float > &src, const SimpleTensor< float > &weights, const SimpleTensor< float > &bias, const TensorShape &output_shape, const PadStrideInfo &info)
 
template<typename T , typename std::enable_if< is_floating_point< T >::value, int >::type >
SimpleTensor< T > log_softmax_layer (const SimpleTensor< T > &src, float beta, int32_t axis)
 
template SimpleTensor< float > log_softmax_layer (const SimpleTensor< float > &src, float beta, int32_t axis)
 
template SimpleTensor< halflog_softmax_layer (const SimpleTensor< half > &src, float beta, int32_t axis)
 
template SimpleTensor< uint8_t > log_softmax_layer (const SimpleTensor< uint8_t > &src, float beta, int32_t axis)
 
template SimpleTensor< int8_t > log_softmax_layer (const SimpleTensor< int8_t > &src, float beta, int32_t axis)
 
template<typename T >
SimpleTensor< T > magnitude (const SimpleTensor< T > &gx, const SimpleTensor< T > &gy, MagnitudeType magnitude_type)
 
template SimpleTensor< int16_t > magnitude (const SimpleTensor< int16_t > &gx, const SimpleTensor< int16_t > &gy, MagnitudeType magnitude_type)
 
template SimpleTensor< int32_t > magnitude (const SimpleTensor< int32_t > &gx, const SimpleTensor< int32_t > &gy, MagnitudeType magnitude_type)
 
template SimpleTensor< half_float::half > magnitude (const SimpleTensor< half_float::half > &gx, const SimpleTensor< half_float::half > &gy, MagnitudeType magnitude_type)
 
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 >
SimpleTensor< T > median3x3 (const SimpleTensor< T > &src, BorderMode border_mode, T constant_border_value)
 
template SimpleTensor< uint8_t > median3x3 (const SimpleTensor< uint8_t > &src, BorderMode border_mode, uint8_t constant_border_value)
 
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_linear_filter (const SimpleTensor< T > &src, NonLinearFilterFunction function, unsigned int mask_size, MatrixPattern pattern, const uint8_t *mask, BorderMode border_mode, uint8_t constant_border_value)
 
template SimpleTensor< uint8_t > non_linear_filter (const SimpleTensor< uint8_t > &src, NonLinearFilterFunction function, unsigned int mask_size, MatrixPattern pattern, const uint8_t *mask, BorderMode border_mode, uint8_t constant_border_value)
 
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 >
std::vector< KeyPointoptical_flow (const SimpleTensor< T > &old_input, const SimpleTensor< T > &new_input, const OpticalFlowParameters &params, size_t num_levels, const std::vector< KeyPoint > &old_points, const std::vector< KeyPoint > &new_points_estimates, BorderMode border_mode, uint8_t constant_border_value)
 
template std::vector< KeyPointoptical_flow (const SimpleTensor< uint8_t > &old_input, const SimpleTensor< uint8_t > &new_input, const OpticalFlowParameters &params, size_t num_levels, const std::vector< KeyPoint > &old_points, const std::vector< KeyPoint > &new_points_estimates, BorderMode border_mode, uint8_t constant_border_value)
 
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 T >
SimpleTensor< uint8_t > phase (const SimpleTensor< T > &gx, const SimpleTensor< T > &gy, PhaseType phase_type)
 
template SimpleTensor< uint8_t > phase (const SimpleTensor< int16_t > &gx, const SimpleTensor< int16_t > &gy, PhaseType phase_type)
 
template SimpleTensor< uint8_t > phase (const SimpleTensor< int32_t > &gx, const SimpleTensor< int32_t > &gy, PhaseType phase_type)
 
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< 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< 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)
 
template<>
SimpleTensor< uint8_t > reduction_operation (const SimpleTensor< uint8_t > &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op)
 
template<>
SimpleTensor< int8_t > reduction_operation (const SimpleTensor< int8_t > &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op)
 
template SimpleTensor< float > reduction_operation (const SimpleTensor< float > &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op)
 
template SimpleTensor< halfreduction_operation (const SimpleTensor< half > &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op)
 
template SimpleTensor< int32_t > reduction_operation (const SimpleTensor< int32_t > &src, const TensorShape &dst_shape, unsigned int axis, ReductionOperation op)
 
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<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<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_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 >
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 , typename U >
std::pair< SimpleTensor< T >, SimpleTensor< T > > scharr (const SimpleTensor< U > &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value, GradientDimension gradient_dimension)
 
template std::pair< SimpleTensor< int16_t >, SimpleTensor< int16_t > > scharr (const SimpleTensor< uint8_t > &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value, GradientDimension gradient_dimension)
 
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 U >
std::pair< SimpleTensor< T >, SimpleTensor< T > > sobel (const SimpleTensor< U > &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value, GradientDimension gradient_dimension)
 
template std::pair< SimpleTensor< int16_t >, SimpleTensor< int16_t > > sobel (const SimpleTensor< uint8_t > &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value, GradientDimension gradient_dimension)
 
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)
 
template SimpleTensor< float > softmax_layer (const SimpleTensor< float > &src, float beta, int32_t axis)
 
template SimpleTensor< halfsoftmax_layer (const SimpleTensor< half > &src, float beta, int32_t axis)
 
template SimpleTensor< uint8_t > softmax_layer (const SimpleTensor< uint8_t > &src, float beta, int32_t axis)
 
template SimpleTensor< int8_t > softmax_layer (const SimpleTensor< int8_t > &src, float beta, int32_t axis)
 
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 > threshold (const SimpleTensor< T > &src, T threshold, T false_value, T true_value, ThresholdType type, T upper)
 
template SimpleTensor< uint8_t > threshold (const SimpleTensor< uint8_t > &src, uint8_t threshold, uint8_t false_value, uint8_t true_value, ThresholdType type, uint8_t upper)
 
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 > upsample_layer (const SimpleTensor< T > &src, const Size2D &info, const InterpolationPolicy policy)
 
template SimpleTensor< float > upsample_layer (const SimpleTensor< float > &src, const Size2D &info, const InterpolationPolicy policy)
 
template SimpleTensor< halfupsample_layer (const SimpleTensor< half > &src, const Size2D &info, const InterpolationPolicy policy)
 
template SimpleTensor< uint8_t > upsample_layer (const SimpleTensor< uint8_t > &src, const Size2D &info, const InterpolationPolicy policy)
 
template SimpleTensor< int8_t > upsample_layer (const SimpleTensor< int8_t > &src, const Size2D &info, const InterpolationPolicy policy)
 
bool valid_bilinear_policy (float xn, float yn, int width, int height, BorderMode border_mode)
 
template<typename T >
SimpleTensor< T > warp_affine (const SimpleTensor< T > &src, SimpleTensor< T > &valid_mask, const float *matrix, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value)
 
template SimpleTensor< uint8_t > warp_affine (const SimpleTensor< uint8_t > &src, SimpleTensor< uint8_t > &valid_mask, const float *matrix, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value)
 
template<typename T >
SimpleTensor< T > warp_perspective (const SimpleTensor< T > &src, SimpleTensor< T > &valid_mask, const float *matrix, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value)
 
template SimpleTensor< uint8_t > warp_perspective (const SimpleTensor< uint8_t > &src, SimpleTensor< uint8_t > &valid_mask, const float *matrix, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value)
 
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)
 
template<typename T , typename std::enable_if< is_floating_point< T >::value, int >::type >
SimpleTensor< T > yolo_layer (const SimpleTensor< T > &src, const ActivationLayerInfo &info, int32_t num_classes)
 
template<>
SimpleTensor< uint8_t > yolo_layer< uint8_t > (const SimpleTensor< uint8_t > &src, const ActivationLayerInfo &info, int32_t num_classes)
 
template SimpleTensor< float > yolo_layer (const SimpleTensor< float > &src, const ActivationLayerInfo &info, int32_t num_classes)
 
template SimpleTensor< halfyolo_layer (const SimpleTensor< half > &src, const ActivationLayerInfo &info, int32_t num_classes)
 

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 ADD(x, y)
List of all the operations supported by this kernel.
#define SUB(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.

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 }

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

◆ 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.

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 }
std::unique_ptr< AssetsLibrary > library
Definition: main.cpp:78
cast configure & src
Definition: Cast.cpp:169

References arm_compute::test::validation::dst, arm_compute::test::library, arm_compute::test::validation::output_data_type, and arm_compute::test::validation::src.

◆ 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.

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 }
std::unique_ptr< AssetsLibrary > library
Definition: main.cpp:78
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Definition: Error.h:456
cast configure & src
Definition: Cast.cpp:169

References ARM_COMPUTE_ERROR_ON_MSG, arm_compute::test::validation::dst, arm_compute::test::library, arm_compute::test::validation::output_data_type, arm_compute::test::validation::shift, and arm_compute::test::validation::src.

◆ 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.

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 }
std::unique_ptr< AssetsLibrary > library
Definition: main.cpp:78
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Definition: Error.h:456
cast configure & src
Definition: Cast.cpp:169

References arm_compute::test::validation::alpha, ARM_COMPUTE_ERROR_ON_MSG, arm_compute::test::validation::dst, arm_compute::test::library, arm_compute::test::validation::output_data_type, and arm_compute::test::validation::src.

◆ 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.

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

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

◆ 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.

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
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:152
cast configure & src
Definition: Cast.cpp:169

References ARM_COMPUTE_UNUSED, arm_compute::test::validation::b, arm_compute::test::validation::dst, arm_compute::test::validation::info, and arm_compute::test::validation::src.

Referenced by batch_normalization_layer().

◆ 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.

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 > convert_from_symmetric(const SimpleTensor< int16_t > &src)
Definition: Helpers.cpp:223
cast configure & src
Definition: Cast.cpp:169

References arm_compute::test::validation::convert_from_symmetric(), arm_compute::test::validation::dst, QuantizationInfo::empty(), arm_compute::test::validation::info, and arm_compute::test::validation::src.

◆ 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.

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:112
cast configure & src
Definition: Cast.cpp:169

References arm_compute::test::validation::convert_from_asymmetric(), arm_compute::test::validation::dst, QuantizationInfo::empty(), arm_compute::test::validation::info, and arm_compute::test::validation::src.

◆ 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.

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:112
cast configure & src
Definition: Cast.cpp:169

References arm_compute::test::validation::convert_from_asymmetric(), arm_compute::test::validation::dst, QuantizationInfo::empty(), arm_compute::test::validation::info, and arm_compute::test::validation::src.

◆ 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.

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 }

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

◆ 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.

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 }

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

Referenced by laplacian_reconstruct().

◆ 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.

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 }
SimpleTensor< float > convert_from_asymmetric(const SimpleTensor< uint8_t > &src)
Definition: Helpers.cpp:112
TensorShape shape() const override
Shape of the tensor.
Definition: SimpleTensor.h:321

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

◆ 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.

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:112

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

◆ 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.

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 }

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

◆ arithmetic_operation() [5/13]

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

◆ arithmetic_operation() [6/13]

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

◆ arithmetic_operation() [7/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 187 of file ArithmeticOperations.cpp.

188 {
189  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.");
190 
191  SimpleTensor<T> dst(TensorShape::broadcast_shape(src1.shape(), src2.shape()), dst_data_type);
192  arithmetic_operation<T>(op, src1, src2, dst, convert_policy);
193  return dst;
194 }
bool is_data_type_quantized(DataType dt)
Check if a given data type is of quantized type.
Definition: Utils.h:1131
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Definition: Error.h:456

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

◆ arithmetic_operation() [8/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() [9/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() [10/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() [11/13]

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

◆ arithmetic_operation() [12/13]

template SimpleTensor<int32_t> arm_compute::test::validation::reference::arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< int32_t > &  src1,
const SimpleTensor< int32_t > &  src2,
SimpleTensor< int32_t > &  dst,
ConvertPolicy  convert_policy 
)

◆ arithmetic_operation() [13/13]

template SimpleTensor<int32_t> arm_compute::test::validation::reference::arithmetic_operation ( ArithmeticOperation  op,
const SimpleTensor< int32_t > &  src1,
const SimpleTensor< int32_t > &  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.

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)
cast configure & src
Definition: Cast.cpp:169

References activation_layer(), ActivationLayerInfo::enabled(), arm_compute::quantization::epsilon, and arm_compute::test::validation::src.

◆ 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.

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
cast configure & src
Definition: Cast.cpp:169

References ARM_COMPUTE_ERROR_ON, arm_compute::test::validation::dst_shape, and arm_compute::test::validation::src.

◆ 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.

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 }

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

◆ 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.

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 }
cast configure & src
Definition: Cast.cpp:169

References arm_compute::test::validation::dst, and arm_compute::test::validation::src.

◆ 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.

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 }

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

◆ 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.

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 }

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

◆ 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.

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:510
#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
DataType
Available data types.
Definition: Types.h:77

References ARM_COMPUTE_ERROR_ON, SimpleTensor< T >::data(), SimpleTensor< T >::data_type(), arm_compute::test::validation::info, offset(), and SimpleTensor< T >::shape().

◆ 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.

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:112

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

◆ box3x3() [1/2]

SimpleTensor< T > box3x3 ( const SimpleTensor< T > &  src,
BorderMode  border_mode,
constant_border_value 
)

Definition at line 38 of file Box3x3.cpp.

39 {
40  SimpleTensor<T> dst(src.shape(), src.data_type());
41  const std::array<T, 9> filter{ { 1, 1, 1, 1, 1, 1, 1, 1, 1 } };
42  const float scale = 1.f / static_cast<float>(filter.size());
43  const uint32_t num_elements = src.num_elements();
44 #if defined(_OPENMP)
45  #pragma omp parallel for
46 #endif /* _OPENMP */
47  for(uint32_t element_idx = 0; element_idx < num_elements; ++element_idx)
48  {
49  const Coordinates id = index2coord(src.shape(), element_idx);
50  apply_2d_spatial_filter(id, src, dst, TensorShape(3U, 3U), filter.data(), scale, border_mode, constant_border_value);
51  }
52  return dst;
53 }
void apply_2d_spatial_filter(Coordinates coord, const SimpleTensor< T > &src, SimpleTensor< U > &dst, const TensorShape &filter_shape, const V *filter_itr, double scale, BorderMode border_mode, T constant_border_value=T(0))
Definition: Utils.h:98
Coordinates index2coord(const TensorShape &shape, int index)
Convert a linear index into n-dimensional coordinates.
Definition: Utils.h:460
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)
Definition: Scale.cpp:187
cast configure & src
Definition: Cast.cpp:169

References arm_compute::test::validation::apply_2d_spatial_filter(), arm_compute::test::validation::border_mode, arm_compute::test::validation::dst, arm_compute::test::index2coord(), scale(), arm_compute::test::validation::src, and arm_compute::utils::cast::U.

◆ box3x3() [2/2]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::box3x3 ( const SimpleTensor< uint8_t > &  src,
BorderMode  border_mode,
uint8_t  constant_border_value 
)

◆ canny_edge_detector() [1/2]

SimpleTensor< T > canny_edge_detector ( const SimpleTensor< T > &  src,
int32_t  upper_thresh,
int32_t  lower_thresh,
int  gradient_size,
MagnitudeType  norm_type,
BorderMode  border_mode,
constant_border_value 
)

Definition at line 234 of file CannyEdgeDetector.cpp.

237 {
238  if(gradient_size < 7)
239  {
240  return canny_edge_detector_impl<int16_t>(src, upper_thresh, lower_thresh, gradient_size, norm_type, border_mode, constant_border_value);
241  }
242  else
243  {
244  return canny_edge_detector_impl<int32_t>(src, upper_thresh, lower_thresh, gradient_size, norm_type, border_mode, constant_border_value);
245  }
246 }
cast configure & src
Definition: Cast.cpp:169

References arm_compute::test::validation::border_mode, and arm_compute::test::validation::src.

◆ canny_edge_detector() [2/2]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::canny_edge_detector ( const SimpleTensor< uint8_t > &  src,
int32_t  upper_thresh,
int32_t  lower_thresh,
int  gradient_size,
MagnitudeType  norm_type,
BorderMode  border_mode,
uint8_t  constant_border_value 
)

◆ channel_combine() [1/2]

std::vector< SimpleTensor< T > > channel_combine ( const TensorShape shape,
const std::vector< SimpleTensor< T >> &  image_planes,
Format  format 
)

Definition at line 91 of file ChannelCombine.cpp.

92 {
93  std::vector<SimpleTensor<T>> dst = create_image_planes<T>(shape, format);
94 
95 #if defined(_OPENMP)
96  #pragma omp parallel for
97 #endif /* _OPENMP */
98  for(unsigned int plane_idx = 0; plane_idx < dst.size(); ++plane_idx)
99  {
100  SimpleTensor<T> &dst_tensor = dst[plane_idx];
101  const uint32_t num_elements = dst_tensor.num_elements();
102 
103  for(uint32_t element_idx = 0; element_idx < num_elements; ++element_idx)
104  {
105  Coordinates coord = index2coord(dst_tensor.shape(), element_idx);
106 
107  switch(format)
108  {
109  case Format::RGB888:
110  case Format::RGBA8888:
111  {
112  // Copy R/G/B or A channel
113  for(int channel_idx = 0; channel_idx < dst_tensor.num_channels(); ++channel_idx)
114  {
115  const T &src_value = reinterpret_cast<const T *>(image_planes[channel_idx](coord))[0];
116  T &dst_value = reinterpret_cast<T *>(dst_tensor(coord))[channel_idx];
117 
118  dst_value = src_value;
119  }
120  break;
121  }
122  case Format::YUYV422:
123  case Format::UYVY422:
124  {
125  // Find coordinates of the sub-sampled pixel
126  const Coordinates coord_hori(coord.x() / 2, coord.y());
127 
128  const T &src0 = reinterpret_cast<const T *>(image_planes[0](coord))[0];
129  const T &src1 = reinterpret_cast<const T *>(image_planes[1](coord_hori))[0];
130 
131  const int shift = (Format::YUYV422 == format) ? 1 : 0;
132  T &dst0 = reinterpret_cast<T *>(dst_tensor(coord))[1 - shift];
133  T &dst1 = reinterpret_cast<T *>(dst_tensor(coord))[0 + shift];
134 
135  dst0 = src0;
136  dst1 = src1;
137 
138  Coordinates coord2 = index2coord(dst_tensor.shape(), ++element_idx);
139 
140  const T &src2 = reinterpret_cast<const T *>(image_planes[0](coord2))[0];
141  const T &src3 = reinterpret_cast<const T *>(image_planes[2](coord_hori))[0];
142 
143  T &dst2 = reinterpret_cast<T *>(dst_tensor(coord2))[1 - shift];
144  T &dst3 = reinterpret_cast<T *>(dst_tensor(coord2))[0 + shift];
145 
146  dst2 = src2;
147  dst3 = src3;
148 
149  break;
150  }
151  case Format::NV12:
152  case Format::NV21:
153  {
154  if(0U == plane_idx)
155  {
156  // Get and combine Y channel from plane0 of destination multi-image
157  dst_tensor[element_idx] = image_planes[0][element_idx];
158  }
159  else
160  {
161  const int shift = (Format::NV12 == format) ? 0 : 1;
162 
163  // Get U channel from plane1 and V channel from plane2 of the source
164  const T &src_u0 = reinterpret_cast<const T *>(image_planes[1](coord))[0];
165  const T &src_v0 = reinterpret_cast<const T *>(image_planes[2](coord))[0];
166 
167  // Get U and V channel from plane1 of destination multi-image
168  T &dst_u0 = reinterpret_cast<T *>(dst_tensor(coord))[0 + shift];
169  T &dst_v0 = reinterpret_cast<T *>(dst_tensor(coord))[1 - shift];
170 
171  // Combine channel U and V
172  dst_u0 = src_u0;
173  dst_v0 = src_v0;
174  }
175 
176  break;
177  }
178  case Format::IYUV:
179  case Format::YUV444:
180  {
181  // Get Y/U/V element
182  const T &src = reinterpret_cast<const T *>(image_planes[plane_idx](coord))[0];
183  T &dst = reinterpret_cast<T *>(dst_tensor(coord))[0];
184 
185  // Copy Y/U/V plane
186  dst = src;
187 
188  break;
189  }
190  default:
191  ARM_COMPUTE_ERROR("Not supported");
192  break;
193  }
194  }
195  }
196 
197  return dst;
198 }
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352
Coordinates index2coord(const TensorShape &shape, int index)
Convert a linear index into n-dimensional coordinates.
Definition: Utils.h:460
cast configure & src
Definition: Cast.cpp:169

References ARM_COMPUTE_ERROR, arm_compute::test::validation::dst, arm_compute::test::index2coord(), arm_compute::IYUV, SimpleTensor< T >::num_channels(), SimpleTensor< T >::num_elements(), arm_compute::NV12, arm_compute::NV21, arm_compute::RGB888, arm_compute::RGBA8888, arm_compute::test::validation::shape, SimpleTensor< T >::shape(), arm_compute::test::validation::shift, arm_compute::test::validation::src, arm_compute::utils::cast::U, arm_compute::UYVY422, Dimensions< T >::x(), Dimensions< T >::y(), arm_compute::YUV444, and arm_compute::YUYV422.

◆ channel_combine() [2/2]

template std::vector<SimpleTensor<uint8_t> > arm_compute::test::validation::reference::channel_combine ( const TensorShape shape,
const std::vector< SimpleTensor< uint8_t >> &  image_planes,
Format  format 
)

◆ channel_extract() [1/2]

SimpleTensor< uint8_t > channel_extract ( const TensorShape shape,
const std::vector< SimpleTensor< T >> &  tensor_planes,
Format  format,
Channel  channel 
)

Definition at line 38 of file ChannelExtract.cpp.

39 {
40  // Find plane and channel index
41  const unsigned int plane_idx = plane_idx_from_channel(format, channel);
42  const unsigned int channel_idx = channel_idx_from_format(format, channel);
43 
44  // Create dst and get src tensor
45  SimpleTensor<T> src = tensor_planes[plane_idx];
46  SimpleTensor<T> dst{ calculate_subsampled_shape(shape, format, channel), Format::U8 };
47 
48  // Single planar formats with subsampling require a double horizontal step
49  const int step_x = ((Format::YUYV422 == format || Format::UYVY422 == format) && Channel::Y != channel) ? 2 : 1;
50  const int width = dst.shape().x();
51  const int height = dst.shape().y();
52 
53  // Loop over each pixel and extract channel
54 #if defined(_OPENMP)
55  #pragma omp parallel for collapse(2)
56 #endif /* _OPENMP */
57  for(int y = 0; y < height; ++y)
58  {
59  for(int x = 0; x < width; ++x)
60  {
61  const Coordinates src_coord{ x * step_x, y };
62  const Coordinates dst_coord{ x, y };
63 
64  const auto *src_pixel = reinterpret_cast<const T *>(src(src_coord));
65  auto *dst_pixel = reinterpret_cast<T *>(dst(dst_coord));
66 
67  dst_pixel[0] = src_pixel[channel_idx]; // NOLINT
68  }
69  }
70 
71  return dst;
72 }
int plane_idx_from_channel(Format format, Channel channel)
Return the plane index of a given channel given an input format.
Definition: Utils.h:258
TensorShape calculate_subsampled_shape(const TensorShape &shape, Format format, Channel channel=Channel::UNKNOWN)
Calculate subsampled shape for a given format and channel.
Definition: Utils.h:770
int channel_idx_from_format(Format format, Channel channel)
Return the channel index of a given channel given an input format.
Definition: Utils.h:323
cast configure & src
Definition: Cast.cpp:169

References arm_compute::calculate_subsampled_shape(), arm_compute::channel_idx_from_format(), arm_compute::test::validation::dst, arm_compute::plane_idx_from_channel(), arm_compute::test::validation::shape, arm_compute::test::validation::src, arm_compute::U8, arm_compute::UYVY422, arm_compute::Y, and arm_compute::YUYV422.

◆ channel_extract() [2/2]

template SimpleTensor<uint8_t> arm_compute::test::validation::reference::channel_extract ( const TensorShape shape,
const std::vector< SimpleTensor< uint8_t >> &  tensor_planes,
Format  format,
Channel  channel 
)

◆ channel_shuffle() [1/6]

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

Definition at line 39 of file ChannelShuffle.cpp.

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 }
SimpleTensor< T > copy(const SimpleTensor< T > &src, const TensorShape &output_shape)
Definition: Copy.cpp:37
const unsigned int num_groups
Definition: Im2Col.cpp:148
SimpleTensor< float > src_ref
Definition: Im2Col.cpp:187
cast configure & src
Definition: Cast.cpp:169

References copy(), arm_compute::test::validation::dst, arm_compute::test::validation::dst_ref, arm_compute::test::validation::num_groups, arm_compute::test::validation::src, and arm_compute::test::validation::src_ref.

◆ 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.

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
int coord2index(const TensorShape &shape, const Coordinates &coord)
Linearise the given coordinate.
Definition: Utils.h:489
T x() const
Alias to access the size of the first dimension.
Definition: Dimensions.h:81
T z() const
Alias to access the size of the third dimension.
Definition: Dimensions.h:91
const unsigned int num_groups
Definition: Im2Col.cpp:148
size_t total_size() const
Collapses all dimensions to a single linear total size.
Definition: TensorShape.h:171
T y() const
Alias to access the size of the second dimension.
Definition: Dimensions.h:86
cast configure & src
Definition: Cast.cpp:169

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

◆ 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 
)

◆ color_convert() [1/2]

std::vector< SimpleTensor< T > > color_convert ( const TensorShape shape,
const std::vector< SimpleTensor< T >> &  tensor_planes,
Format  src_format,
Format  dst_format 
)

Definition at line 93 of file ColorConvert.cpp.

94 {
95  std::vector<SimpleTensor<T>> dst = create_image_planes<T>(shape, dst_format);
96 
97  switch(src_format)
98  {
99  case Format::RGB888:
100  {
101  switch(dst_format)
102  {
103  case Format::RGBA8888:
105  break;
106  case Format::U8:
108  break;
109  case Format::NV12:
111  break;
112  case Format::IYUV:
114  break;
115  case Format::YUV444:
117  break;
118  default:
119  ARM_COMPUTE_ERROR("Not Supported");
120  break;
121  }
122  break;
123  }
124  case Format::RGBA8888:
125  {
126  switch(dst_format)
127  {
128  case Format::RGB888:
130  break;
131  case Format::NV12:
133  break;
134  case Format::IYUV:
136  break;
137  case Format::YUV444:
139  break;
140  default:
141  ARM_COMPUTE_ERROR("Not Supported");
142  break;
143  }
144  break;
145  }
146  case Format::UYVY422:
147  case Format::YUYV422:
148  {
149  switch(dst_format)
150  {
151  case Format::RGB888:
152  case Format::RGBA8888:
153  colorconvert_helper::detail::colorconvert_yuyv_to_rgb(tensor_planes[0], src_format, dst[0]);
154  break;
155  case Format::NV12:
156  colorconvert_helper::detail::colorconvert_yuyv_to_nv12(tensor_planes[0], src_format, dst);
157  break;
158  case Format::IYUV:
159  colorconvert_helper::detail::colorconvert_yuyv_to_iyuv(tensor_planes[0], src_format, dst);
160  break;
161  default:
162  ARM_COMPUTE_ERROR("Not Supported");
163  break;
164  }
165  break;
166  }
167  case Format::IYUV:
168  {
169  switch(dst_format)
170  {
171  case Format::RGB888:
172  case Format::RGBA8888:
174  break;
175  default:
176  ARM_COMPUTE_ERROR("Not Supported");
177  break;
178  }
179  break;
180  }
181  case Format::NV12:
182  case Format::NV21:
183  {
184  switch(dst_format)
185  {
186  case Format::RGB888:
187  case Format::RGBA8888:
188  colorconvert_helper::detail::colorconvert_nv12_to_rgb(src_format, tensor_planes, dst[0]);
189  break;
190  case Format::IYUV:
191  colorconvert_helper::detail::colorconvert_nv_to_iyuv(tensor_planes, src_format, dst);
192  break;
193  case Format::YUV444:
194  colorconvert_helper::detail::colorconvert_nv_to_yuv4(tensor_planes, src_format, dst);
195  break;
196  default:
197  ARM_COMPUTE_ERROR("Not Supported");
198  break;
199  }
200  break;
201  }
202  default:
203  ARM_COMPUTE_ERROR("Not supported");
204  break;
205  }
206  return dst;
207 }
void colorconvert_nv_to_iyuv(const std::vector< SimpleTensor< T >> src, const Format src_format, std::vector< SimpleTensor< T >> &dst)
void colorconvert_rgb_to_yuv4(const void *__restrict input, void *__restrict output, const Window &win)
Convert RGB to YUV4.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352
void colorconvert_rgbx_to_rgb(const void *input, void *output, const Window &win)
Convert RGBX to RGB.
void colorconvert_nv_to_yuv4(const std::vector< SimpleTensor< T >> src, const Format src_format, std::vector< SimpleTensor< T >> &dst)
void colorconvert_rgb_to_u8(const void *__restrict input, void *__restrict output, const Window &win)
Convert RGB to U8.
void colorconvert_rgb_to_iyuv(const void *__restrict input, void *__restrict output, const Window &win)
Convert RGB to IYUV.
void colorconvert_rgb_to_rgbx(const void *__restrict input, void *__restrict output, const Window &win)
Convert RGB to RGBX.
void colorconvert_nv12_to_rgb(const void *__restrict input, void *__restrict output, const Window &win)
Convert NV12 to RGB.
void colorconvert_yuyv_to_rgb(const void *__restrict input, void *__restrict output, const Window &win)
Convert YUYV to RGB.
void colorconvert_rgb_to_nv12(const void *__restrict input, void *__restrict output, const Window &win)
Convert RGB to NV12.
void colorconvert_yuyv_to_iyuv(const void *__restrict input, void *__restrict output, const Window &win)
Convert YUYV to IYUV.
void colorconvert_yuyv_to_nv12(const void *__restrict input, void *__restrict output, const Window &win)
Convert YUYV to NV12.
void colorconvert_iyuv_to_rgb(const void *__restrict input, void *__restrict output, const Window &win)
Convert IYUV to RGB.

References ARM_COMPUTE_ERROR, arm_compute::test::colorconvert_helper::detail::colorconvert_iyuv_to_rgb(), arm_compute::test::colorconvert_helper::detail::colorconvert_nv12_to_rgb(), arm_compute::test::colorconvert_helper::detail::colorconvert_nv_to_iyuv(), arm_compute::test::colorconvert_helper::detail::colorconvert_nv_to_yuv4(), arm_compute::test::colorconvert_helper::detail::colorconvert_rgb_to_iyuv(), arm_compute::test::colorconvert_helper::detail::colorconvert_rgb_to_nv12(), arm_compute::test::colorconvert_helper::detail::colorconvert_rgb_to_rgbx(), arm_compute::test::colorconvert_helper::detail::colorconvert_rgb_to_u8(), arm_compute::test::colorconvert_helper::detail::colorconvert_rgb_to_yuv4(), arm_compute::test::colorconvert_helper::detail::colorconvert_rgbx_to_rgb(), arm_compute::test::colorconvert_helper::detail::colorconvert_yuyv_to_iyuv(), arm_compute::test::colorconvert_helper::detail::colorconvert_yuyv_to_nv12(), arm_compute::test::colorconvert_helper::detail::colorconvert_yuyv_to_rgb(), arm_compute::test::validation::dst, arm_compute::IYUV, arm_compute::NV12, arm_compute::NV21, arm_compute::RGB888, arm_compute::RGBA8888, arm_compute::test::validation::shape, arm_compute::U8, arm_compute::UYVY422, arm_compute::YUV444, and arm_compute::YUYV422.

◆ color_convert() [2/2]

template std::vector<SimpleTensor<uint8_t> > arm_compute::test::validation::reference::color_convert ( const TensorShape shape,
const std::vector< SimpleTensor< uint8_t >> &  tensor_planes,
Format  src_format,
Format  dst_format 
)

◆ 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.

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 }

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

◆ 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.

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:358
SimpleTensor< float > convert_from_asymmetric(const SimpleTensor< uint8_t > &src)
Definition: Helpers.cpp:112
TensorShape shape() const override
Shape of the tensor.
Definition: SimpleTensor.h:321

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.

◆ 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.

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:112

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 >::shape(), and arm_compute::U8.

◆ 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.

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 }

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

Referenced by compute_all_anchors().

◆ 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.

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)
SimpleTensor< float > convert_from_symmetric(const SimpleTensor< int16_t > &src)
Definition: Helpers.cpp:223

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

◆ 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.

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
cast configure & src
Definition: Cast.cpp:169

References ARM_COMPUTE_ERROR_ON, and arm_compute::test::validation::src.

◆ 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.

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 }
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Definition: Error.h:352
DataType
Available data types.
Definition: Types.h:77
cast configure & src
Definition: Cast.cpp:169

References arm_compute::ARG_IDX_MAX, arm_compute::ARG_IDX_MIN, ARM_COMPUTE_ERROR, arm_compute::test::validation::axis, arm_compute::test::validation::dst, arm_compute::test::validation::dst_shape, arm_compute::test::validation::output_data_type, arm_compute::S32, and arm_compute::test::validation::src.

◆ 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.

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

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

◆ 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/2]

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 394 of file DFT.cpp.

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

References arm_compute::test::validation::axis, arm_compute::test::validation::conv_info, copy(), pad_layer(), rdft_2d(), reverse(), ridft_2d(), slice(), arm_compute::test::validation::src, arm_compute::utils::cast::U, arm_compute::U32, and arm_compute::test::validation::w.

◆ conv2d_dft() [2/2]

template SimpleTensor<float> arm_compute::test::validation::reference::conv2d_dft ( const SimpleTensor< float > &  src,
const SimpleTensor< float > &  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.

36 {
37  SimpleTensor<T> dst(src.shape(),