ArmNN
 21.11
ReduceProdTestImpl.cpp File Reference

Go to the source code of this file.

Functions

template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceProdSimpleTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceProdSingleAxisTest1 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceProdSingleAxisTest2 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceProdSingleAxisTest3 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceProdMultipleAxisTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceProdSimpleTest< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceProdSingleAxisTest1< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceProdSingleAxisTest2< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceProdSingleAxisTest3< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceProdMultipleAxisTest< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 

Function Documentation

◆ ReduceProdMultipleAxisTest()

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

Definition at line 276 of file ReduceProdTestImpl.cpp.

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

280 {
281  const armnn::TensorShape inputShape{ 1, 3, 2, 4 };
282  const armnn::TensorShape outputShape{ 1, 1, 1, 4 };
283 
284  armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType);
285 
286  if (armnn::IsQuantizedType<T>())
287  {
288  inputTensorInfo.SetQuantizationScale(1.0f);
289  inputTensorInfo.SetQuantizationOffset(0);
290  }
291 
292  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
293 
294  std::vector<float> inputValues({ 1.0f, 2.0f, 3.0f, 4.0f,
295  5.0f, 6.0f, 7.0f, 8.0f,
296 
297  10.0f, 20.0f, 30.0f, 40.0f,
298  50.0f, 60.0f, 70.0f, 80.0f,
299 
300  11.0f, 22.0f, 33.0f, 44.0f,
301  55.0f, 66.0f, 77.0f, 88.0f });
302  std::vector<float> outputValues({ 1512500.f, 20908800.f, 112058100.f, 396492800.f });
303 
304  return ReduceTestCommon<ArmnnType>(workloadFactory,
305  memoryManager,
306  tensorHandleFactory,
307  inputTensorInfo,
308  outputTensorInfo,
309  inputValues,
310  outputValues,
311  { 1, 2 },
313 }

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

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

◆ ReduceProdSimpleTest()

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

Definition at line 82 of file ReduceProdTestImpl.cpp.

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

86 {
87  const armnn::TensorShape inputShape{ 1, 1, 1, 5 };
88  const armnn::TensorShape outputShape{ 1, 1, 1, 1 };
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({ 5.0f, 2.0f, 8.0f, 10.0f, 9.0f });
101  std::vector<float> outputValues({ 7200.0f });
102 
103  return ReduceTestCommon<ArmnnType>(workloadFactory,
104  memoryManager,
105  tensorHandleFactory,
106  inputTensorInfo,
107  outputTensorInfo,
108  inputValues,
109  outputValues,
110  { -1 },
112 }

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

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

◆ ReduceProdSingleAxisTest1()

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

Definition at line 115 of file ReduceProdTestImpl.cpp.

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

119 {
120  const armnn::TensorShape inputShape{ 1, 3, 2, 4 };
121  const armnn::TensorShape outputShape{ 1, 1, 2, 4 };
122 
123  armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType);
124 
125  if (armnn::IsQuantizedType<T>())
126  {
127  inputTensorInfo.SetQuantizationScale(1.0f);
128  inputTensorInfo.SetQuantizationOffset(0);
129  }
130 
131  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
132 
133  std::vector<float> inputValues({ 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f,
134  10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f,
135  100.0f, 200.0f, 300.0f, 400.0f, 500.0f, 600.0f, 700.0f, 800.0f
136  });
137  std::vector<float> outputValues({ 1000.0f, 8000.0f, 27000.0f, 64000.0f, 125000.0f, 216000.0f, 343000.0f, 512000.0f
138  });
139 
140  return ReduceTestCommon<ArmnnType>(workloadFactory,
141  memoryManager,
142  tensorHandleFactory,
143  inputTensorInfo,
144  outputTensorInfo,
145  inputValues,
146  outputValues,
147  { 1 },
149 }

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

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

◆ ReduceProdSingleAxisTest2()

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

Definition at line 152 of file ReduceProdTestImpl.cpp.

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

156 {
157  const armnn::TensorShape inputShape{ 1, 6, 3, 4 };
158  const armnn::TensorShape outputShape{ 1, 1, 3, 4};
159 
160  armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType);
161 
162  if (armnn::IsQuantizedType<T>())
163  {
164  inputTensorInfo.SetQuantizationScale(1.0f);
165  inputTensorInfo.SetQuantizationOffset(0);
166  }
167 
168  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
169 
170  std::vector<float> inputValues( {7, 8, 6, 1,
171  1, 1, 8, 7,
172  3, 7, 7, 7,
173 
174  6, 8, 4, 7,
175  3, 8, 7, 3,
176  5, 8, 8, 8,
177 
178 
179  7, 8, 2, 7,
180  3, 8, 5, 6,
181  8, 4, 2, 7,
182 
183  1, 6, 7, 2,
184  8, 3, 3, 1,
185  7, 6, 2, 6,
186 
187 
188  5, 3, 4, 8,
189  7, 8, 2, 4,
190  6, 6, 2, 8,
191 
192  2, 2, 7, 2,
193  5, 3, 6, 3,
194  6, 1, 8, 8});
195  std::vector<float> outputValues({ 2940.f, 18432.f, 9408.f, 1568.f,
196  2520.f, 4608.f, 10080.f, 1512.f,
197  30240.f, 8064.f, 3584.f, 150528.f });
198 
199  return ReduceTestCommon<ArmnnType>(workloadFactory,
200  memoryManager,
201  tensorHandleFactory,
202  inputTensorInfo,
203  outputTensorInfo,
204  inputValues,
205  outputValues,
206  { 1 },
208 }

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

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

◆ ReduceProdSingleAxisTest3()

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

Definition at line 211 of file ReduceProdTestImpl.cpp.

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

215 {
216  const armnn::TensorShape inputShape{ 1, 6, 3, 4 };
217  const armnn::TensorShape outputShape{ 1, 6, 3, 1 };
218 
219  armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType);
220 
221  if (armnn::IsQuantizedType<T>())
222  {
223  inputTensorInfo.SetQuantizationScale(1.0f);
224  inputTensorInfo.SetQuantizationOffset(0);
225  }
226 
227  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
228 
229  std::vector<float> inputValues({ 7, 8, 6, 1,
230  1, 1, 8, 7,
231  3, 7, 7, 7,
232 
233  6, 8, 4, 7,
234  3, 8, 7, 3,
235  5, 8, 8, 8,
236 
237 
238  7, 8, 2, 7,
239  3, 8, 5, 6,
240  8, 4, 2, 7,
241 
242  1, 6, 7, 2,
243  8, 3, 3, 1,
244  7, 6, 2, 6,
245 
246 
247  5, 3, 4, 8,
248  7, 8, 2, 4,
249  6, 6, 2, 8,
250 
251  2, 2, 7, 2,
252  5, 3, 6, 3,
253  6, 1, 8, 8 });
254  std::vector<float> outputValues({ 336.f, 56.f, 1029.f,
255  1344.f, 504.f, 2560.f,
256 
257  784.f, 720.f, 448.f,
258  84.f, 72.f, 504.f,
259 
260  480.f, 448.f, 576.f,
261  56.f, 270.f, 384.f });
262 
263  return ReduceTestCommon<ArmnnType>(workloadFactory,
264  memoryManager,
265  tensorHandleFactory,
266  inputTensorInfo,
267  outputTensorInfo,
268  inputValues,
269  outputValues,
270  { 3 },
272  true);
273 }

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

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