ArmNN
 22.02
ReductionTestImpl.cpp File Reference
#include "ReductionTestImpl.hpp"
#include <DataTypeUtils.hpp>
#include <armnnTestUtils/TensorCopyUtils.hpp>
#include <armnnTestUtils/WorkloadTestUtils.hpp>
#include <armnnTestUtils/TensorHelpers.hpp>
#include <iostream>

Go to the source code of this file.

Functions

template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceMaxSimpleTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceMaxNegativeAxisTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceMaxSimpleTest2 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceMinSimpleTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceMinNegativeAxisTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceMaxSimpleTest< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceMaxNegativeAxisTest< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceMaxSimpleTest2< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceMinSimpleTest< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceMinNegativeAxisTest< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 

Function Documentation

◆ ReduceMaxNegativeAxisTest()

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

Definition at line 126 of file ReductionTestImpl.cpp.

References armnn::Float32, armnn::Max, TensorInfo::SetQuantizationOffset(), and TensorInfo::SetQuantizationScale().

130 {
131  const armnn::TensorShape inputShape{ 1, 1, 2, 3 };
132  const armnn::TensorShape outputShape{ 1, 1, 2, 1};
133 
134  armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType);
135 
136  if (armnn::IsQuantizedType<T>())
137  {
138  inputTensorInfo.SetQuantizationScale(1.0f);
139  inputTensorInfo.SetQuantizationOffset(0);
140  }
141 
142  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
143 
144  std::vector<float> inputValues
145  ({
146  1001.0f, 11.0f, 1003.0f,
147  10.0f, 1002.0f, 12.0f
148  });
149  std::vector<float> outputValues
150  ({
151  1003.0f, 1002.0f
152  });
153 
154  return ReductionTestCommon<ArmnnType>(workloadFactory,
155  memoryManager,
156  tensorHandleFactory,
157  inputTensorInfo,
158  outputTensorInfo,
159  inputValues,
160  outputValues,
161  { -1 },
163  true);
164 }

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

template LayerTestResult<float, 4> ReduceMaxNegativeAxisTest< armnn::DataType::Float32 > ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

◆ ReduceMaxSimpleTest()

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

Definition at line 86 of file ReductionTestImpl.cpp.

References armnn::Float32, armnn::Max, TensorInfo::SetQuantizationOffset(), and TensorInfo::SetQuantizationScale().

90 {
91  const armnn::TensorShape inputShape{ 1, 1, 2, 3 };
92  const armnn::TensorShape outputShape{ 1, 1, 1, 3};
93 
94  armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType);
95 
96  if (armnn::IsQuantizedType<T>())
97  {
98  inputTensorInfo.SetQuantizationScale(1.0f);
99  inputTensorInfo.SetQuantizationOffset(0);
100  }
101 
102  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
103 
104  std::vector<float> inputValues
105  ({
106  1001.0f, 11.0f, 1003.0f,
107  10.0f, 1002.0f, 12.0f
108  });
109  std::vector<float> outputValues
110  ({
111  1001.0f, 1002.0f, 1003.0f
112  });
113 
114  return ReductionTestCommon<ArmnnType>(workloadFactory,
115  memoryManager,
116  tensorHandleFactory,
117  inputTensorInfo,
118  outputTensorInfo,
119  inputValues,
120  outputValues,
121  { 2 },
123 }

◆ ReduceMaxSimpleTest2()

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

Definition at line 167 of file ReductionTestImpl.cpp.

References armnn::Float32, armnn::Max, TensorInfo::SetQuantizationOffset(), and TensorInfo::SetQuantizationScale().

171 {
172  const armnn::TensorShape inputShape{ 1, 1, 2, 3 };
173  const armnn::TensorShape outputShape{ 1, 1, 2, 1 };
174 
175  armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType);
176 
177  if (armnn::IsQuantizedType<T>())
178  {
179  inputTensorInfo.SetQuantizationScale(1.0f);
180  inputTensorInfo.SetQuantizationOffset(0);
181  }
182 
183  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
184 
185  std::vector<float> inputValues
186  ({
187  1.0f, 3.0f, 2.0f,
188  6.0f, 4.0f, 5.0f
189  });
190 
191  std::vector<float> outputValues
192  ({
193  3.0f, 6.0f
194  });
195 
196  return ReductionTestCommon<ArmnnType>(workloadFactory,
197  memoryManager,
198  tensorHandleFactory,
199  inputTensorInfo,
200  outputTensorInfo,
201  inputValues,
202  outputValues,
203  { 3 },
205  true);
206 }

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

template LayerTestResult<float, 4> ReduceMaxSimpleTest2< armnn::DataType::Float32 > ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

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

template LayerTestResult<float, 4> ReduceMaxSimpleTest< armnn::DataType::Float32 > ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

◆ ReduceMinNegativeAxisTest()

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

Definition at line 249 of file ReductionTestImpl.cpp.

References armnn::Float32, armnn::Min, TensorInfo::SetQuantizationOffset(), and TensorInfo::SetQuantizationScale().

253 {
254  const armnn::TensorShape inputShape{ 1, 1, 2, 3 };
255  const armnn::TensorShape outputShape{ 1, 1, 2, 1};
256 
257  armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType);
258 
259  if (armnn::IsQuantizedType<T>())
260  {
261  inputTensorInfo.SetQuantizationScale(1.0f);
262  inputTensorInfo.SetQuantizationOffset(0);
263  }
264 
265  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
266 
267  std::vector<float> inputValues
268  ({
269  1001.0f, 11.0f, 1003.0f,
270  10.0f, 1002.0f, 12.0f
271  });
272  std::vector<float> outputValues
273  ({
274  11.0f, 10.0f
275  });
276 
277  return ReductionTestCommon<ArmnnType>(workloadFactory,
278  memoryManager,
279  tensorHandleFactory,
280  inputTensorInfo,
281  outputTensorInfo,
282  inputValues,
283  outputValues,
284  { -1 },
286  true);
287 }

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

template LayerTestResult<float, 4> ReduceMinNegativeAxisTest< armnn::DataType::Float32 > ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)

◆ ReduceMinSimpleTest()

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

Definition at line 209 of file ReductionTestImpl.cpp.

References armnn::Float32, armnn::Min, TensorInfo::SetQuantizationOffset(), and TensorInfo::SetQuantizationScale().

213 {
214  const armnn::TensorShape inputShape { 1, 1, 2, 3 };
215  const armnn::TensorShape outputShape { 1, 1, 1, 3};
216 
217  armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType);
218 
219  if (armnn::IsQuantizedType<T>())
220  {
221  inputTensorInfo.SetQuantizationScale(1.0f);
222  inputTensorInfo.SetQuantizationOffset(0);
223  }
224 
225  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
226 
227  std::vector<float> inputValues
228  ({
229  1001.0f, 11.0f, 1003.0f,
230  10.0f, 1002.0f, 12.0f
231  });
232  std::vector<float> outputValues
233  ({
234  10.0f, 11.0f, 12.0f
235  });
236 
237  return ReductionTestCommon<ArmnnType>(workloadFactory,
238  memoryManager,
239  tensorHandleFactory,
240  inputTensorInfo,
241  outputTensorInfo,
242  inputValues,
243  outputValues,
244  { 2 },
246 }

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

template LayerTestResult<float, 4> ReduceMinSimpleTest< armnn::DataType::Float32 > ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager,
const armnn::ITensorHandleFactory tensorHandleFactory 
)