ArmNN
 20.11
LogSoftmaxTestImpl.hpp File Reference

Go to the source code of this file.

Functions

template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > LogSoftmaxTest1 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > LogSoftmaxTest2 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > LogSoftmaxTest3 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > LogSoftmaxTest4 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 

Function Documentation

◆ LogSoftmaxTest1()

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

Definition at line 71 of file LogSoftmaxTestImpl.cpp.

References SoftmaxDescriptor::m_Axis, SoftmaxDescriptor::m_Beta, and QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters.

75 {
76  const armnn::TensorShape inputOutputShape{1, 1, 2, 4};
77 
78  armnn::TensorInfo inputTensorInfo(inputOutputShape, ArmnnType);
79  armnn::TensorInfo outputTensorInfo(inputOutputShape, ArmnnType);
80 
81  std::vector<float> inputValues
82  {
83  0.f, -6.f, 2.f, 4.f,
84  3.f, -2.f, 10.f, 1.f
85  };
86 
87  std::vector<float> expectedOutputValues
88  {
89  -4.14297f, -10.14297f, -2.14297f, -0.14297f,
90  -7.00104f, -12.00104f, -0.00105f, -9.00104f
91  };
92 
94  descriptor.m_Parameters.m_Beta = 1.0f; // default beta
95  descriptor.m_Parameters.m_Axis = -1; // default axis
96 
97  return LogSoftmaxTestImpl<ArmnnType, 4>(
98  workloadFactory,
99  memoryManager,
100  tensorHandleFactory,
101  inputTensorInfo,
102  outputTensorInfo,
103  inputValues,
104  expectedOutputValues,
105  descriptor);
106 }
int m_Axis
Scalar, defaulted to the last index (-1), specifying the dimension the activation will be performed o...
float m_Beta
Exponentiation value.

◆ LogSoftmaxTest2()

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

Definition at line 109 of file LogSoftmaxTestImpl.cpp.

References SoftmaxDescriptor::m_Axis, SoftmaxDescriptor::m_Beta, and QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters.

113 {
114  const armnn::TensorShape inputOutputShape{1, 1, 2, 4};
115 
116  armnn::TensorInfo inputTensorInfo(inputOutputShape, ArmnnType);
117  armnn::TensorInfo outputTensorInfo(inputOutputShape, ArmnnType);
118 
119  std::vector<float> inputValues
120  {
121  0.f, -6.f, 2.f, 4.f,
122  3.f, -2.f, 10.f, 1.f
123  };
124 
125  std::vector<float> expectedOutputValues
126  {
127  -4.14297f, -10.14297f, -2.14297f, -0.14297f,
128  -7.00104f, -12.00104f, -0.00105f, -9.00104f
129  };
130 
132  descriptor.m_Parameters.m_Beta = 1.0f; // default beta
133  descriptor.m_Parameters.m_Axis = 3; // positive axis
134 
135  return LogSoftmaxTestImpl<ArmnnType, 4>(
136  workloadFactory,
137  memoryManager,
138  tensorHandleFactory,
139  inputTensorInfo,
140  outputTensorInfo,
141  inputValues,
142  expectedOutputValues,
143  descriptor);
144 }
int m_Axis
Scalar, defaulted to the last index (-1), specifying the dimension the activation will be performed o...
float m_Beta
Exponentiation value.

◆ LogSoftmaxTest3()

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

Definition at line 147 of file LogSoftmaxTestImpl.cpp.

References SoftmaxDescriptor::m_Axis, SoftmaxDescriptor::m_Beta, and QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters.

151 {
152  const armnn::TensorShape inputOutputShape{1, 1, 2, 4};
153 
154  armnn::TensorInfo inputTensorInfo(inputOutputShape, ArmnnType);
155  armnn::TensorInfo outputTensorInfo(inputOutputShape, ArmnnType);
156 
157  std::vector<float> inputValues
158  {
159  0.0f, -0.6f, 0.2f, 0.4f,
160  0.3f, -0.2f, 1.0f, 0.1f
161  };
162 
163  std::vector<float> expectedOutputValues
164  {
165  -4.14297f, -10.14297f, -2.14297f, -0.14297f,
166  -7.00104f, -12.00104f, -0.00105f, -9.00104f
167  };
168 
170  descriptor.m_Parameters.m_Beta = 10.0f; // non-default beta
171  descriptor.m_Parameters.m_Axis = 3; // positive axis
172 
173  return LogSoftmaxTestImpl<ArmnnType, 4>(
174  workloadFactory,
175  memoryManager,
176  tensorHandleFactory,
177  inputTensorInfo,
178  outputTensorInfo,
179  inputValues,
180  expectedOutputValues,
181  descriptor);
182 }
int m_Axis
Scalar, defaulted to the last index (-1), specifying the dimension the activation will be performed o...
float m_Beta
Exponentiation value.

◆ LogSoftmaxTest4()

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

Definition at line 185 of file LogSoftmaxTestImpl.cpp.

References SoftmaxDescriptor::m_Axis, SoftmaxDescriptor::m_Beta, and QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters.

189 {
190  const armnn::TensorShape inputOutputShape{1, 1, 2, 4};
191 
192  armnn::TensorInfo inputTensorInfo(inputOutputShape, ArmnnType);
193  armnn::TensorInfo outputTensorInfo(inputOutputShape, ArmnnType);
194 
195  std::vector<float> inputValues
196  {
197  0.f, -6.f, 2.f, 4.f,
198  3.f, -2.f, 10.f, 1.f
199  };
200 
201  std::vector<float> expectedOutputValues
202  {
203  -3.048587f, -4.018149f, -8.000336f, -0.048587f,
204  -0.048587f, -0.018149f, -0.000335f, -3.048587f
205  };
206 
208  descriptor.m_Parameters.m_Beta = 1.0f; // default beta
209  descriptor.m_Parameters.m_Axis = -2; // negative axis
210 
211  return LogSoftmaxTestImpl<ArmnnType, 4>(
212  workloadFactory,
213  memoryManager,
214  tensorHandleFactory,
215  inputTensorInfo,
216  outputTensorInfo,
217  inputValues,
218  expectedOutputValues,
219  descriptor);
220 }
int m_Axis
Scalar, defaulted to the last index (-1), specifying the dimension the activation will be performed o...
float m_Beta
Exponentiation value.