ONE - On-device Neural Engine
Loading...
Searching...
No Matches
TestUtils.h File Reference
#include "luci_interpreter/core/Tensor.h"
#include "luci_interpreter/MemoryManager.h"
#include <type_traits>
#include <limits>
#include <gtest/gtest.h>
#include <gmock/gmock.h>

Go to the source code of this file.

Namespaces

namespace  luci_interpreter
 
namespace  luci_interpreter::kernels
 
namespace  luci_interpreter::kernels::testing
 

Functions

template<typename T >
std::vector< T > luci_interpreter::kernels::testing::quantize (const float *data, size_t num_elements, float scale, int32_t zero_point)
 
template<DataType DT>
Tensor luci_interpreter::kernels::testing::makeInputTensor (const Shape &shape, const std::vector< typename DataTypeImpl< DT >::Type > &data, IMemoryManager *memory_manager)
 
template<DataType DT>
Tensor luci_interpreter::kernels::testing::makeInputTensor (const Shape &shape, float scale, int32_t zero_point, const std::vector< float > &data, IMemoryManager *memory_manager)
 Create layer-wise quantized tensor.
 
template<DataType DT>
Tensor luci_interpreter::kernels::testing::makeInputTensor (const Shape &shape, const std::vector< float > &scales, const std::vector< int32_t > &zero_points, int quantized_dimension, const std::vector< float > &data, IMemoryManager *memory_manager)
 Create channel-wise quantized tensor.
 
Tensor luci_interpreter::kernels::testing::makeOutputTensor (DataType element_type)
 
Tensor luci_interpreter::kernels::testing::makeOutputTensor (DataType element_type, float scale, int32_t zero_point)
 
std::vector< int32_t > luci_interpreter::kernels::testing::extractTensorShape (const Tensor &tensor)
 
template<typename T >
constexpr DataType luci_interpreter::kernels::testing::getElementType ()
 
template<typename T >
std::vector< T > luci_interpreter::kernels::testing::extractTensorData (const Tensor &tensor)
 
std::vector< float > luci_interpreter::kernels::testing::dequantizeTensorData (const Tensor &tensor)
 
Matcher< std::vector< float > > luci_interpreter::kernels::testing::FloatArrayNear (const std::vector< float > &values, float max_abs_error)
 
template<typename T >
std::vector< float > luci_interpreter::kernels::testing::dequantize (const T *data, size_t num_elements, float scale, int32_t zero_point)
 
template<typename T >
std::pair< float, int32_t > luci_interpreter::kernels::testing::quantizationParams (float f_min, float f_max)
 
float luci_interpreter::kernels::testing::getTolerance (float min, float max, int quantize_steps)