ArmNN
 22.02
LogTestImpl.hpp File Reference

Go to the source code of this file.

Functions

template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 2 > Log2dTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 3 > Log3dTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 2 > LogZeroTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 2 > LogNegativeTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 

Function Documentation

◆ Log2dTest()

LayerTestResult<T, 2> Log2dTest ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 10 of file LogTestImpl.cpp.

References armnn::Log.

14 {
15  const unsigned int inputShape[] = { 2, 2 };
16 
17  std::vector<float> inputValues
18  {
19  3.0f, 2.7182818284f,
20  1.0f, 1.1f
21  };
22 
23  std::vector<float> expectedOutputValues
24  {
25  1.09861228867f, 0.99999999997f,
26  0.0f, 0.0953101798f
27  };
28 
29  return ElementwiseUnaryTestHelper<2, ArmnnType>(
30  workloadFactory,
31  memoryManager,
33  inputShape,
34  inputValues,
35  inputShape,
36  expectedOutputValues,
37  tensorHandleFactory);
38 }

◆ Log3dTest()

LayerTestResult<T, 3> Log3dTest ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 41 of file LogTestImpl.cpp.

References armnn::Log.

45 {
46  const unsigned int inputShape[] = { 3, 1, 2 };
47 
48  std::vector<float> inputValues
49  {
50  5.0f, 4.0f,
51  3.0f, 2.7182818284f,
52  1.0f, 1.1f
53  };
54 
55  std::vector<float> expectedOutputValues
56  {
57  1.60943791243f, 1.38629436112f,
58  1.09861228867f, 0.99999999997f,
59  0.0f, 0.0953101798f
60  };
61 
62  return ElementwiseUnaryTestHelper<3, ArmnnType>(
63  workloadFactory,
64  memoryManager,
66  inputShape,
67  inputValues,
68  inputShape,
69  expectedOutputValues,
70  tensorHandleFactory);
71 }

◆ LogNegativeTest()

LayerTestResult<T, 2> LogNegativeTest ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 103 of file LogTestImpl.cpp.

References armnn::Log.

107 {
108  const unsigned int inputShape[] = { 1, 2 };
109 
110  std::vector<float> inputValues
111  {
112  -5.9f, -5.8f
113  };
114 
115  std::vector<float> expectedOutputValues
116  {
117  -std::numeric_limits<float>::quiet_NaN(), -std::numeric_limits<float>::quiet_NaN()
118  };
119 
120  return ElementwiseUnaryTestHelper<2, ArmnnType>(
121  workloadFactory,
122  memoryManager,
124  inputShape,
125  inputValues,
126  inputShape,
127  expectedOutputValues,
128  tensorHandleFactory);
129 }

◆ LogZeroTest()

LayerTestResult<T, 2> LogZeroTest ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

Definition at line 74 of file LogTestImpl.cpp.

References armnn::Log.

78 {
79  const unsigned int inputShape[] = { 1, 2 };
80 
81  std::vector<float> inputValues
82  {
83  0.f, 0.f
84  };
85 
86  std::vector<float> expectedOutputValues
87  {
88  -std::numeric_limits<float>::infinity(), -std::numeric_limits<float>::infinity()
89  };
90 
91  return ElementwiseUnaryTestHelper<2, ArmnnType>(
92  workloadFactory,
93  memoryManager,
95  inputShape,
96  inputValues,
97  inputShape,
98  expectedOutputValues,
99  tensorHandleFactory);
100 }