ArmNN
 21.02
DivisionTestImpl.hpp File Reference

Go to the source code of this file.

Functions

LayerTestResult< float, 4 > DivisionByZeroTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< float, 4 > DivisionTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< float, 4 > DivisionBroadcast1ElementTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< float, 4 > DivisionBroadcast1DVectorTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< armnn::Half, 4 > DivisionFloat16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< armnn::Half, 4 > DivisionBroadcast1ElementFloat16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< armnn::Half, 4 > DivisionBroadcast1DVectorFloat16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< uint8_t, 4 > DivisionUint8Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< uint8_t, 4 > DivisionBroadcast1ElementUint8Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< uint8_t, 4 > DivisionBroadcast1DVectorUint8Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< int16_t, 4 > DivisionInt16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< int16_t, 4 > DivisionBroadcast1ElementInt16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< int16_t, 4 > DivisionBroadcast1DVectorInt16Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< int32_t, 4 > DivisionInt32Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< int32_t, 4 > DivisionBroadcast1ElementInt32Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
LayerTestResult< int32_t, 4 > DivisionBroadcast1DVectorInt32Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 

Function Documentation

◆ DivisionBroadcast1DVectorFloat16Test()

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

Definition at line 238 of file DivisionTestImpl.cpp.

242 {
243  using namespace half_float::literal;
244 
245  unsigned int shape0[] = { 1, 3, 3, 2 };
246  unsigned int shape1[] = { 1, 1, 1, 2 };
247 
248  std::vector<armnn::Half> input0 =
249  {
250  1._h, 4._h, 3._h, 8._h, 5._h, 12._h,
251  7._h, 16._h, 9._h, 20._h, 11._h, 24._h,
252  13._h, 28._h, 15._h, 32._h, 17._h, 36._h
253  };
254 
255  std::vector<armnn::Half> input1 = { 1._h, 2._h };
256 
257  std::vector<armnn::Half> output =
258  {
259  1._h, 2._h, 3._h, 4._h, 5._h, 6._h,
260  7._h, 8._h, 9._h, 10._h, 11._h, 12._h,
261  13._h, 14._h, 15._h, 16._h, 17._h, 18._h
262  };
263 
264  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float16>(
265  workloadFactory,
266  memoryManager,
267  shape0,
268  input0,
269  shape1,
270  input1,
271  shape0,
272  output,
273  tensorHandleFactory);
274 }

◆ DivisionBroadcast1DVectorInt16Test()

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

Definition at line 447 of file DivisionTestImpl.cpp.

451 {
452  unsigned int shape0[] = { 1, 3, 3, 2 };
453  unsigned int shape1[] = { 1, 1, 1, 2 };
454 
455  std::vector<int16_t> input0 =
456  {
457  1, 4, 3, 8, 5, 12,
458  7, 16, 9, 20, 11, 24,
459  13, 28, 15, 32, 17, 36
460  };
461 
462  std::vector<int16_t> input1 = { 1, 2 };
463 
464  std::vector<int16_t> output =
465  {
466  1, 2, 3, 4, 5, 6,
467  7, 8, 9, 10, 11, 12,
468  13, 14, 15, 16, 17, 18
469  };
470 
471  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::QSymmS16>(
472  workloadFactory,
473  memoryManager,
474  shape0,
475  input0,
476  shape1,
477  input1,
478  shape0,
479  output,
480  tensorHandleFactory);
481 }

◆ DivisionBroadcast1DVectorInt32Test()

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

Definition at line 554 of file DivisionTestImpl.cpp.

558 {
559  unsigned int shape0[] = { 1, 3, 3, 2 };
560  unsigned int shape1[] = { 1, 1, 1, 2 };
561 
562  std::vector<int32_t> input0 =
563  {
564  1, 4, 3, 8, 5, 12,
565  7, 16, 9, 20, 11, 24,
566  13, 28, 15, 32, 17, 36
567  };
568 
569  std::vector<int32_t> input1 = { 1, 2 };
570 
571  std::vector<int32_t> output =
572  {
573  1, 2, 3, 4, 5, 6,
574  7, 8, 9, 10, 11, 12,
575  13, 14, 15, 16, 17, 18
576  };
577 
578  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Signed32>(
579  workloadFactory,
580  memoryManager,
581  shape0,
582  input0,
583  shape1,
584  input1,
585  shape0,
586  output,
587  tensorHandleFactory);
588 }

◆ DivisionBroadcast1DVectorTest()

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

Definition at line 130 of file DivisionTestImpl.cpp.

134 {
135  unsigned int shape0[] = { 1, 3, 3, 2 };
136  unsigned int shape1[] = { 1, 1, 1, 2 };
137 
138  std::vector<float> input0 =
139  {
140  1.f, 4.f, 3.f, 8.f, 5.f, 12.f,
141  7.f, 16.f, 9.f, 20.f, 11.f, 24.f,
142  13.f, 28.f, 15.f, 32.f, 17.f, 36.f
143  };
144 
145  std::vector<float> input1 = { 1.f, 2.f };
146 
147  std::vector<float> output =
148  {
149  1.f, 2.f, 3.f, 4.f, 5.f, 6.f,
150  7.f, 8.f, 9.f, 10.f, 11.f, 12.f,
151  13.f, 14.f, 15.f, 16.f, 17.f, 18.f
152  };
153 
154  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float32>(
155  workloadFactory,
156  memoryManager,
157  shape0,
158  input0,
159  shape1,
160  input1,
161  shape0,
162  output,
163  tensorHandleFactory);
164 }

◆ DivisionBroadcast1DVectorUint8Test()

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

Definition at line 346 of file DivisionTestImpl.cpp.

350 {
351  unsigned int shape0[] = { 1, 3, 3, 2 };
352  unsigned int shape1[] = { 1, 1, 1, 2 };
353 
354  std::vector<uint8_t> input0 =
355  {
356  1, 4, 3, 8, 5, 12,
357  7, 16, 9, 20, 11, 24,
358  13, 28, 15, 32, 17, 36
359  };
360 
361  std::vector<uint8_t> input1 = { 1, 2 };
362 
363  std::vector<uint8_t> output =
364  {
365  1, 2, 3, 4, 5, 6,
366  7, 8, 9, 10, 11, 12,
367  13, 14, 15, 16, 17, 18
368  };
369 
370  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::QAsymmU8>(
371  workloadFactory,
372  memoryManager,
373  shape0,
374  input0,
375  shape1,
376  input1,
377  shape0,
378  output,
379  tensorHandleFactory);
380 }

◆ DivisionBroadcast1ElementFloat16Test()

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

Definition at line 210 of file DivisionTestImpl.cpp.

214 {
215  using namespace half_float::literal;
216 
217  unsigned int shape0[] = { 1, 2, 2, 2 };
218  unsigned int shape1[] = { 1, 1, 1, 1 };
219 
220  std::vector<armnn::Half> input0({ 2._h, 4._h, 6._h, 8._h, 10._h, 12._h, 14._h, 16._h});
221 
222  std::vector<armnn::Half> input1({ 2._h });
223 
224  std::vector<armnn::Half> output({ 1._h, 2._h, 3._h, 4._h, 5._h, 6._h, 7._h, 8._h});
225 
226  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float16>(
227  workloadFactory,
228  memoryManager,
229  shape0,
230  input0,
231  shape1,
232  input1,
233  shape0,
234  output,
235  tensorHandleFactory);
236 }

◆ DivisionBroadcast1ElementInt16Test()

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

Definition at line 421 of file DivisionTestImpl.cpp.

425 {
426  unsigned int shape0[] = { 1, 2, 2, 2 };
427  unsigned int shape1[] = { 1, 1, 1, 1 };
428 
429  std::vector<int16_t> input0 = { 2, 4, 6, 8, 10, 12, 14, 16};
430 
431  std::vector<int16_t> input1 = { 2 };
432 
433  std::vector<int16_t> output = { 1, 2, 3, 4, 5, 6, 7, 8};
434 
435  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::QSymmS16>(
436  workloadFactory,
437  memoryManager,
438  shape0,
439  input0,
440  shape1,
441  input1,
442  shape0,
443  output,
444  tensorHandleFactory);
445 }

◆ DivisionBroadcast1ElementInt32Test()

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

Definition at line 528 of file DivisionTestImpl.cpp.

532 {
533  unsigned int shape0[] = { 1, 2, 2, 2 };
534  unsigned int shape1[] = { 1, 1, 1, 1 };
535 
536  std::vector<int32_t> input0 = { 2, 4, 6, 8, 10, 12, 14, 16};
537 
538  std::vector<int32_t> input1 = { 2 };
539 
540  std::vector<int32_t> output = { 1, 2, 3, 4, 5, 6, 7, 8};
541 
542  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Signed32>(
543  workloadFactory,
544  memoryManager,
545  shape0,
546  input0,
547  shape1,
548  input1,
549  shape0,
550  output,
551  tensorHandleFactory);
552 }

◆ DivisionBroadcast1ElementTest()

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

Definition at line 104 of file DivisionTestImpl.cpp.

108 {
109  unsigned int shape0[] = { 1, 2, 2, 2 };
110  unsigned int shape1[] = { 1, 1, 1, 1 };
111 
112  std::vector<float> input0({ 2, 4, 6, 8, 10, 12, 14, 16});
113 
114  std::vector<float> input1({ 2 });
115 
116  std::vector<float> output({ 1, 2, 3, 4, 5, 6, 7, 8});
117 
118  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float32>(
119  workloadFactory,
120  memoryManager,
121  shape0,
122  input0,
123  shape1,
124  input1,
125  shape0,
126  output,
127  tensorHandleFactory);
128 }

◆ DivisionBroadcast1ElementUint8Test()

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

Definition at line 320 of file DivisionTestImpl.cpp.

324 {
325  unsigned int shape0[] = { 1, 2, 2, 2 };
326  unsigned int shape1[] = { 1, 1, 1, 1 };
327 
328  std::vector<uint8_t> input0 = { 2, 4, 6, 8, 10, 12, 14, 16};
329 
330  std::vector<uint8_t> input1 = { 2 };
331 
332  std::vector<uint8_t> output = { 1, 2, 3, 4, 5, 6, 7, 8};
333 
334  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::QAsymmU8>(
335  workloadFactory,
336  memoryManager,
337  shape0,
338  input0,
339  shape1,
340  input1,
341  shape0,
342  output,
343  tensorHandleFactory);
344 }

◆ DivisionByZeroTest()

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

Definition at line 19 of file DivisionTestImpl.cpp.

References armnn::IgnoreUnused().

23 {
24  IgnoreUnused(memoryManager);
25  const unsigned int width = 2u;
26  const unsigned int height = 2u;
27  const unsigned int channelCount = 2u;
28  const unsigned int batchSize = 2u;
29 
30  unsigned int shape[] = { batchSize, channelCount, height, width };
31 
32  std::vector<float> input0 =
33  {
34  1.f, 1.f, 1.f, 1.f, 0.f, 0.f, 0.f, 0.f,
35  -1.f, -1.f, -1.f, -1.f, 5.f, 5.f, 5.f, 5.f
36  };
37 
38  std::vector<float> input1 =
39  {
40  0.f, 0.f, -0.f, -0.f, 0.f, 0.f, -0.f, -0.f,
41  0.f, 0.f, -0.f, -0.f, 5.f, 5.f, 5.f, 5.f
42  };
43 
44  std::vector<float> output =
45  {
46  INFINITY, INFINITY, -INFINITY, -INFINITY, NAN, NAN, -NAN, -NAN,
47  -INFINITY, -INFINITY, INFINITY, INFINITY, 1, 1, 1, 1
48  };
49 
50  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float32>(
51  workloadFactory,
52  memoryManager,
53  shape,
54  input0,
55  shape,
56  input1,
57  shape,
58  output,
59  tensorHandleFactory);
60 }
void IgnoreUnused(Ts &&...)

◆ DivisionFloat16Test()

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

Definition at line 166 of file DivisionTestImpl.cpp.

170 {
171  using namespace half_float::literal;
172 
173  const unsigned int width = 2u;
174  const unsigned int height = 2u;
175  const unsigned int channelCount = 2u;
176  const unsigned int batchSize = 2u;
177 
178  unsigned int shape[] = { batchSize, channelCount, height, width };
179 
180  std::vector<armnn::Half> input0 =
181  {
182  2._h, 2._h, 2._h, 2._h, 3._h, 3._h, 3._h, 3._h,
183  4._h, 4._h, 4._h, 4._h, 5._h, 5._h, 5._h, 5._h
184  };
185 
186  std::vector<armnn::Half> input1 =
187  {
188  1._h, 1._h, 1._h, 1._h, 2._h, 2._h, 2._h, 2._h,
189  4._h, 4._h, 4._h, 4._h, 4._h, 4._h, 4._h, 4._h
190  };
191 
192  std::vector<armnn::Half> output =
193  {
194  2._h, 2._h, 2._h, 2._h, 1.50_h, 1.50_h, 1.50_h, 1.50_h,
195  1._h, 1._h, 1._h, 1._h, 1.25_h, 1.25_h, 1.25_h, 1.25_h
196  };
197 
198  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float16>(
199  workloadFactory,
200  memoryManager,
201  shape,
202  input0,
203  shape,
204  input1,
205  shape,
206  output,
207  tensorHandleFactory);
208 }

◆ DivisionInt16Test()

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

Definition at line 382 of file DivisionTestImpl.cpp.

386 {
387  unsigned int shape[] = { 2, 2, 2, 2 };
388 
389  std::vector<int16_t> input0 =
390  {
391  2, 2, 2, 2, 3, 3, 3, 3,
392  4, 4, 4, 4, 5, 5, 5, 5
393  };
394 
395  std::vector<int16_t> input1 =
396  {
397  1, 1, 1, 1, 2, 2, 2, 2,
398  4, 4, 4, 4, 4, 4, 4, 4
399  };
400 
401  std::vector<int16_t> output =
402  {
403  8, 8, 8, 8, 6, 6, 6, 6,
404  4, 4, 4, 4, 5, 5, 5, 5
405  };
406 
407  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::QSymmS16>(
408  workloadFactory,
409  memoryManager,
410  shape,
411  input0,
412  shape,
413  input1,
414  shape,
415  output,
416  tensorHandleFactory,
417  0.25f,
418  0);
419 }

◆ DivisionInt32Test()

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

Definition at line 483 of file DivisionTestImpl.cpp.

487 {
488  const unsigned int width = 2u;
489  const unsigned int height = 2u;
490  const unsigned int channelCount = 2u;
491  const unsigned int batchSize = 2u;
492 
493  unsigned int shape[] = { batchSize, channelCount, height, width };
494 
495  std::vector<int32_t> input0 =
496  {
497  8, 8, 8, 8, 6, 6, 6, 6,
498  8, 8, 8, 8, 5, 5, 5, 5
499  };
500 
501  std::vector<int32_t> input1 =
502  {
503  4, 4, 4, 4, 2, 2, 2, 2,
504  2, 2, 2, 2, 1, 1, 1, 1
505  };
506 
507  std::vector<int32_t> output =
508  {
509  2, 2, 2, 2, 3, 3, 3, 3,
510  4, 4, 4, 4, 5, 5, 5, 5
511  };
512 
513 
514  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Signed32>(
515  workloadFactory,
516  memoryManager,
517  shape,
518  input0,
519  shape,
520  input1,
521  shape,
522  output,
523  tensorHandleFactory,
524  1.f,
525  0);
526 }

◆ DivisionTest()

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

Definition at line 62 of file DivisionTestImpl.cpp.

Referenced by armnn::GetVector().

66 {
67  const unsigned int width = 2u;
68  const unsigned int height = 2u;
69  const unsigned int channelCount = 2u;
70  const unsigned int batchSize = 2u;
71 
72  unsigned int shape[] = { batchSize, channelCount, height, width };
73 
74  std::vector<float> input0 =
75  {
76  2.f, 2.f, 2.f, 2.f, 3.f, 3.f, 3.f, 3.f,
77  4.f, 4.f, 4.f, 4.f, 5.f, 5.f, 5.f, 5.f
78  };
79 
80  std::vector<float> input1 =
81  {
82  1.f, 1.f, 1.f, 1.f, 2.f, 2.f, 2.f, 2.f,
83  4.f, 4.f, 4.f, 4.f, 4.f, 4.f, 4.f, 4.f
84  };
85 
86  std::vector<float> output =
87  {
88  2.f, 2.f, 2.f, 2.f, 1.50f, 1.50f, 1.50f, 1.50f,
89  1.f, 1.f, 1.f, 1.f, 1.25f, 1.25f, 1.25f, 1.25f
90  };
91 
92  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::Float32>(
93  workloadFactory,
94  memoryManager,
95  shape,
96  input0,
97  shape,
98  input1,
99  shape,
100  output,
101  tensorHandleFactory);
102 }

◆ DivisionUint8Test()

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

Definition at line 276 of file DivisionTestImpl.cpp.

280 {
281  const unsigned int width = 2u;
282  const unsigned int height = 2u;
283  const unsigned int channelCount = 2u;
284  const unsigned int batchSize = 2u;
285 
286  unsigned int shape[] = { batchSize, channelCount, height, width };
287 
288  std::vector<uint8_t> input0 =
289  {
290  2, 2, 2, 2, 3, 3, 3, 3,
291  4, 4, 4, 4, 5, 5, 5, 5
292  };
293 
294  std::vector<uint8_t> input1 =
295  {
296  1, 1, 1, 1, 2, 2, 2, 2,
297  4, 4, 4, 4, 4, 4, 4, 4
298  };
299 
300  std::vector<uint8_t> output =
301  {
302  8, 8, 8, 8, 6, 6, 6, 6,
303  4, 4, 4, 4, 5, 5, 5, 5
304  };
305 
306  return ElementwiseTestHelper<4, armnn::DivisionQueueDescriptor, armnn::DataType::QAsymmU8>(
307  workloadFactory,
308  memoryManager,
309  shape,
310  input0,
311  shape,
312  input1,
313  shape,
314  output,
315  tensorHandleFactory,
316  0.25f,
317  0);
318 }