22.02
|
#include <armnnTestUtils/PredicateResult.hpp>
#include <armnn/Tensor.hpp>
#include <armnn/utility/Assert.hpp>
#include <armnnUtils/FloatingPointComparison.hpp>
#include <armnnUtils/QuantizeHelper.hpp>
#include <doctest/doctest.h>
#include <array>
#include <cmath>
#include <random>
#include <vector>
Go to the source code of this file.
Classes | |
struct | SelectiveComparer< T, isQuantized > |
struct | SelectiveComparer< T, false > |
Functions | |
template<typename T > | |
bool | SelectiveCompare (T a, T b) |
template<typename T > | |
bool | SelectiveCompareBoolean (T a, T b) |
template<typename T > | |
armnn::PredicateResult | CompareTensors (const std::vector< T > &actualData, const std::vector< T > &expectedData, const armnn::TensorShape &actualShape, const armnn::TensorShape &expectedShape, bool compareBoolean=false, bool isDynamic=false) |
template<typename T > | |
std::vector< T > | MakeRandomTensor (const armnn::TensorInfo &tensorInfo, unsigned int seed, float min=-10.0f, float max=10.0f) |
Variables | |
constexpr float | g_FloatCloseToZeroTolerance = 1.0e-6f |
armnn::PredicateResult CompareTensors | ( | const std::vector< T > & | actualData, |
const std::vector< T > & | expectedData, | ||
const armnn::TensorShape & | actualShape, | ||
const armnn::TensorShape & | expectedShape, | ||
bool | compareBoolean = false , |
||
bool | isDynamic = false |
||
) |
Definition at line 73 of file TensorHelpers.hpp.
References TensorShape::GetNumDimensions(), TensorShape::GetNumElements(), PredicateResult::Message(), SelectiveCompare(), SelectiveCompareBoolean(), and PredicateResult::SetResult().
Referenced by CompareTestResultIfSupported(), DetectionPostProcessImpl(), ParserPrototxtFixture< TParser >::RunTest(), ParserFlatbuffersSerializeFixture::RunTest(), ParserFlatbuffersFixture::RunTest(), TEST_CASE_FIXTURE(), and TEST_SUITE().
std::vector<T> MakeRandomTensor | ( | const armnn::TensorInfo & | tensorInfo, |
unsigned int | seed, | ||
float | min = -10.0f , |
||
float | max = 10.0f |
||
) |
Definition at line 217 of file TensorHelpers.hpp.
References TensorInfo::GetNumElements(), TensorInfo::GetQuantizationOffset(), and TensorInfo::GetQuantizationScale().
bool SelectiveCompare | ( | T | a, |
T | b | ||
) |
Definition at line 61 of file TensorHelpers.hpp.
References SelectiveComparer< T, isQuantized >::Compare().
Referenced by CompareTensors().
bool SelectiveCompareBoolean | ( | T | a, |
T | b | ||
) |
Definition at line 67 of file TensorHelpers.hpp.
Referenced by CompareTensors().
constexpr float g_FloatCloseToZeroTolerance = 1.0e-6f |
Definition at line 22 of file TensorHelpers.hpp.
Referenced by SelectiveComparer< T, false >::Compare().