Compute Library
 22.05
Helpers.cpp File Reference
#include "tests/validation/Helpers.h"
#include <algorithm>
#include <cmath>

Go to the source code of this file.

Namespaces

 arm_compute
 Copyright (c) 2017-2022 Arm Limited.
 
 arm_compute::test
 
 arm_compute::test::validation
 

Functions

template<>
SimpleTensor< float > convert_from_asymmetric (const SimpleTensor< uint8_t > &src)
 
template<>
SimpleTensor< float > convert_from_asymmetric (const SimpleTensor< int8_t > &src)
 
template<>
SimpleTensor< float > convert_from_asymmetric (const SimpleTensor< uint16_t > &src)
 
template<>
SimpleTensor< uint8_t > convert_to_asymmetric (const SimpleTensor< float > &src, const QuantizationInfo &quantization_info)
 Convert float simple tensor into quantized using specified quantization information. More...
 
template<>
SimpleTensor< int8_t > convert_to_asymmetric (const SimpleTensor< float > &src, const QuantizationInfo &quantization_info)
 Convert float simple tensor into quantized using specified quantization information. More...
 
template<>
SimpleTensor< uint16_t > convert_to_asymmetric (const SimpleTensor< float > &src, const QuantizationInfo &quantization_info)
 Convert float simple tensor into quantized using specified quantization information. More...
 
template<>
SimpleTensor< int16_t > convert_to_symmetric (const SimpleTensor< float > &src, const QuantizationInfo &quantization_info)
 Convert float simple tensor into quantized using specified quantization information. More...
 
template<>
SimpleTensor< float > convert_from_symmetric (const SimpleTensor< int16_t > &src)
 
template<typename T >
void matrix_multiply (const SimpleTensor< T > &a, const SimpleTensor< T > &b, SimpleTensor< T > &out)
 Matrix multiply between 2 float simple tensors. More...
 
template<typename T >
void transpose_matrix (const SimpleTensor< T > &in, SimpleTensor< T > &out)
 Transpose matrix. More...
 
template<typename T >
void get_tile (const SimpleTensor< T > &in, SimpleTensor< T > &tile, const Coordinates &coord)
 Get a 2D tile from a tensor. More...
 
template<typename T >
void zeros (SimpleTensor< T > &in, const Coordinates &anchor, const TensorShape &shape)
 Fill with zeros the input tensor in the area defined by anchor and shape. More...
 
std::pair< int, int > get_quantized_bounds (const QuantizationInfo &quant_info, float min, float max)
 Helper function to compute quantized min and max bounds. More...
 
std::pair< int, int > get_quantized_qasymm8_signed_bounds (const QuantizationInfo &quant_info, float min, float max)
 Helper function to compute asymmetric quantized signed min and max bounds. More...
 
std::pair< int, int > get_symm_quantized_per_channel_bounds (const QuantizationInfo &quant_info, float min, float max, size_t channel_id=0)
 Helper function to compute symmetric quantized min and max bounds. More...
 
void add_padding_x (std::initializer_list< ITensor * > tensors, const DataLayout &data_layout=DataLayout::NHWC, bool only_right_pad=false)
 Add random padding along the X axis (between 1 and 16 columns per side) to all the input tensors. More...
 
void add_padding_y (std::initializer_list< ITensor * > tensors, const DataLayout &data_layout=DataLayout::NHWC)
 Add random padding along the Y axis (between 1 and 4 rows per side) to all the input tensors. More...
 
template void get_tile (const SimpleTensor< float > &in, SimpleTensor< float > &roi, const Coordinates &coord)
 
template void get_tile (const SimpleTensor< half > &in, SimpleTensor< half > &roi, const Coordinates &coord)
 
template void get_tile (const SimpleTensor< int > &in, SimpleTensor< int > &roi, const Coordinates &coord)
 
template void get_tile (const SimpleTensor< short > &in, SimpleTensor< short > &roi, const Coordinates &coord)
 
template void get_tile (const SimpleTensor< char > &in, SimpleTensor< char > &roi, const Coordinates &coord)
 
template void zeros (SimpleTensor< float > &in, const Coordinates &anchor, const TensorShape &shape)
 
template void zeros (SimpleTensor< half > &in, const Coordinates &anchor, const TensorShape &shape)
 
template void transpose_matrix (const SimpleTensor< float > &in, SimpleTensor< float > &out)
 
template void transpose_matrix (const SimpleTensor< half > &in, SimpleTensor< half > &out)
 
template void transpose_matrix (const SimpleTensor< int > &in, SimpleTensor< int > &out)
 
template void transpose_matrix (const SimpleTensor< short > &in, SimpleTensor< short > &out)
 
template void transpose_matrix (const SimpleTensor< char > &in, SimpleTensor< char > &out)
 
template void transpose_matrix (const SimpleTensor< int8_t > &in, SimpleTensor< int8_t > &out)
 
template void transpose_matrix (const SimpleTensor< uint8_t > &in, SimpleTensor< uint8_t > &out)
 
template void matrix_multiply (const SimpleTensor< float > &a, const SimpleTensor< float > &b, SimpleTensor< float > &out)
 
template void matrix_multiply (const SimpleTensor< half > &a, const SimpleTensor< half > &b, SimpleTensor< half > &out)