ArmNN
 22.05.01
LogSoftmaxTestImpl.cpp File Reference

Go to the source code of this file.

Functions

template<armnn::DataType ArmnnType, typename T >
LayerTestResult< T, 4 > LogSoftmaxTest1 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< T, 4 > LogSoftmaxTest2 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< T, 4 > LogSoftmaxTest3 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< T, 4 > LogSoftmaxTest4 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< armnn::ResolveType< armnn::DataType::Float32 >, 4 > LogSoftmaxTest1< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< armnn::ResolveType< armnn::DataType::Float32 >, 4 > LogSoftmaxTest2< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< armnn::ResolveType< armnn::DataType::Float32 >, 4 > LogSoftmaxTest3< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< armnn::ResolveType< armnn::DataType::Float32 >, 4 > LogSoftmaxTest4< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< armnn::ResolveType< armnn::DataType::Float16 >, 4 > LogSoftmaxTest1< armnn::DataType::Float16 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< armnn::ResolveType< armnn::DataType::Float16 >, 4 > LogSoftmaxTest2< armnn::DataType::Float16 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< armnn::ResolveType< armnn::DataType::Float16 >, 4 > LogSoftmaxTest3< armnn::DataType::Float16 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< armnn::ResolveType< armnn::DataType::Float16 >, 4 > LogSoftmaxTest4< armnn::DataType::Float16 > (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 78 of file LogSoftmaxTestImpl.cpp.

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

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

◆ LogSoftmaxTest1< armnn::DataType::Float16 >()

◆ LogSoftmaxTest1< armnn::DataType::Float32 >()

◆ LogSoftmaxTest2()

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

Definition at line 116 of file LogSoftmaxTestImpl.cpp.

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

120 {
121  const armnn::TensorShape inputOutputShape{1, 1, 2, 4};
122 
123  armnn::TensorInfo inputTensorInfo(inputOutputShape, ArmnnType);
124  armnn::TensorInfo outputTensorInfo(inputOutputShape, ArmnnType);
125 
126  std::vector<float> inputValues
127  {
128  0.f, -6.f, 2.f, 4.f,
129  3.f, -2.f, 10.f, 1.f
130  };
131 
132  std::vector<float> expectedOutputValues
133  {
134  -4.14297f, -10.14297f, -2.14297f, -0.14297f,
135  -7.00104f, -12.00104f, -0.00105f, -9.00104f
136  };
137 
139  descriptor.m_Parameters.m_Beta = 1.0f; // default beta
140  descriptor.m_Parameters.m_Axis = 3; // positive axis
141 
142  return LogSoftmaxTestImpl<ArmnnType, 4>(
143  workloadFactory,
144  memoryManager,
145  tensorHandleFactory,
146  inputTensorInfo,
147  outputTensorInfo,
148  inputValues,
149  expectedOutputValues,
150  descriptor);
151 }
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< armnn::DataType::Float16 >()

◆ LogSoftmaxTest2< armnn::DataType::Float32 >()

◆ LogSoftmaxTest3()

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

Definition at line 154 of file LogSoftmaxTestImpl.cpp.

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

158 {
159  const armnn::TensorShape inputOutputShape{1, 1, 2, 4};
160 
161  armnn::TensorInfo inputTensorInfo(inputOutputShape, ArmnnType);
162  armnn::TensorInfo outputTensorInfo(inputOutputShape, ArmnnType);
163 
164  std::vector<float> inputValues
165  {
166  0.0f, -0.6f, 0.2f, 0.4f,
167  0.3f, -0.2f, 1.0f, 0.1f
168  };
169 
170  std::vector<float> expectedOutputValues
171  {
172  -4.14297f, -10.14297f, -2.14297f, -0.14297f,
173  -7.00104f, -12.00104f, -0.00105f, -9.00104f
174  };
175 
177  descriptor.m_Parameters.m_Beta = 10.0f; // non-default beta
178  descriptor.m_Parameters.m_Axis = 3; // positive axis
179 
180  return LogSoftmaxTestImpl<ArmnnType, 4>(
181  workloadFactory,
182  memoryManager,
183  tensorHandleFactory,
184  inputTensorInfo,
185  outputTensorInfo,
186  inputValues,
187  expectedOutputValues,
188  descriptor);
189 }
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< armnn::DataType::Float16 >()

◆ LogSoftmaxTest3< armnn::DataType::Float32 >()

◆ LogSoftmaxTest4()

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

Definition at line 192 of file LogSoftmaxTestImpl.cpp.

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

196 {
197  const armnn::TensorShape inputOutputShape{1, 1, 2, 4};
198 
199  armnn::TensorInfo inputTensorInfo(inputOutputShape, ArmnnType);
200  armnn::TensorInfo outputTensorInfo(inputOutputShape, ArmnnType);
201 
202  std::vector<float> inputValues
203  {
204  0.f, -6.f, 2.f, 4.f,
205  3.f, -2.f, 10.f, 1.f
206  };
207 
208  std::vector<float> expectedOutputValues
209  {
210  -3.048587f, -4.018149f, -8.000336f, -0.048587f,
211  -0.048587f, -0.018149f, -0.000335f, -3.048587f
212  };
213 
215  descriptor.m_Parameters.m_Beta = 1.0f; // default beta
216  descriptor.m_Parameters.m_Axis = -2; // negative axis
217 
218  return LogSoftmaxTestImpl<ArmnnType, 4>(
219  workloadFactory,
220  memoryManager,
221  tensorHandleFactory,
222  inputTensorInfo,
223  outputTensorInfo,
224  inputValues,
225  expectedOutputValues,
226  descriptor);
227 }
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< armnn::DataType::Float16 >()

◆ LogSoftmaxTest4< armnn::DataType::Float32 >()