ArmNN
 21.08
ReductionTestImpl.cpp File Reference

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 124 of file ReductionTestImpl.cpp.

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

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

◆ 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 84 of file ReductionTestImpl.cpp.

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

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

◆ ReduceMaxSimpleTest2()

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

Definition at line 165 of file ReductionTestImpl.cpp.

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

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

◆ 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 247 of file ReductionTestImpl.cpp.

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

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

◆ 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 207 of file ReductionTestImpl.cpp.

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

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

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

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