ArmNN
 21.02
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 122 of file ReductionTestImpl.cpp.

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

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

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

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

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

◆ ReduceMaxSimpleTest2()

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

Definition at line 163 of file ReductionTestImpl.cpp.

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

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

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

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

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

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

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

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

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

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