ArmNN
 21.08
ReduceSumTestImpl.cpp File Reference

Go to the source code of this file.

Functions

template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceSumSimpleTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceSumSingleAxisTest1 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceSumSingleAxisTest2 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceSumSingleAxisTest3 (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template<armnn::DataType ArmnnType, typename T >
LayerTestResult< float, 4 > ReduceSumMultipleAxisTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceSumSimpleTest< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceSumSingleAxisTest1< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceSumSingleAxisTest2< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceSumSingleAxisTest3< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 
template LayerTestResult< float, 4 > ReduceSumMultipleAxisTest< armnn::DataType::Float32 > (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager, const armnn::ITensorHandleFactory &tensorHandleFactory)
 

Function Documentation

◆ ReduceSumMultipleAxisTest()

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

Definition at line 280 of file ReduceSumTestImpl.cpp.

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

284 {
285  const armnn::TensorShape inputShape{ 1, 3, 2, 4 };
286  const armnn::TensorShape outputShape{ 1, 1, 1, 4};
287 
288  armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType);
289 
290  if (armnn::IsQuantizedType<T>())
291  {
292  inputTensorInfo.SetQuantizationScale(1.0f);
293  inputTensorInfo.SetQuantizationOffset(0);
294  }
295 
296  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
297 
298  std::vector<float> inputValues({ 1.0f, 2.0f, 3.0f, 4.0f,
299  5.0f, 6.0f, 7.0f, 8.0f,
300 
301  10.0f, 20.0f, 30.0f, 40.0f,
302  50.0f, 60.0f, 70.0f, 80.0f,
303 
304  100.0f, 200.0f, 300.0f, 400.0f,
305  500.0f, 600.0f, 700.0f, 800.0f });
306  std::vector<float> outputValues({ 666.0f, 888.0f, 1110.0f, 1332.0f });
307 
308  return ReduceTestCommon<ArmnnType>(workloadFactory,
309  memoryManager,
310  tensorHandleFactory,
311  inputTensorInfo,
312  outputTensorInfo,
313  inputValues,
314  outputValues,
315  { 1, 2 },
317 }

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

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

◆ ReduceSumSimpleTest()

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

Definition at line 82 of file ReduceSumTestImpl.cpp.

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

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({ 34.0f });
102 
103  return ReduceTestCommon<ArmnnType>(workloadFactory,
104  memoryManager,
105  tensorHandleFactory,
106  inputTensorInfo,
107  outputTensorInfo,
108  inputValues,
109  outputValues,
110  { -1 },
112 }

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

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

◆ ReduceSumSingleAxisTest1()

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

Definition at line 115 of file ReduceSumTestImpl.cpp.

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

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,
134  5.0f, 6.0f, 7.0f, 8.0f,
135 
136  10.0f, 20.0f, 30.0f, 40.0f,
137  50.0f, 60.0f, 70.0f, 80.0f,
138 
139  100.0f, 200.0f, 300.0f, 400.0f,
140  500.0f, 600.0f, 700.0f, 800.0f });
141  std::vector<float> outputValues({ 111.0f, 222.0f, 333.0f, 444.0f,
142  555.0f, 666.0f, 777.0f, 888.0f });
143 
144  return ReduceTestCommon<ArmnnType>(workloadFactory,
145  memoryManager,
146  tensorHandleFactory,
147  inputTensorInfo,
148  outputTensorInfo,
149  inputValues,
150  outputValues,
151  { 1 },
153 }

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

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

◆ ReduceSumSingleAxisTest2()

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

Definition at line 156 of file ReduceSumTestImpl.cpp.

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

160 {
161  const armnn::TensorShape inputShape{ 1, 6, 3, 4 };
162  const armnn::TensorShape outputShape{ 1, 1, 3, 4};
163 
164  armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType);
165 
166  if (armnn::IsQuantizedType<T>())
167  {
168  inputTensorInfo.SetQuantizationScale(1.0f);
169  inputTensorInfo.SetQuantizationOffset(0);
170  }
171 
172  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
173 
174  std::vector<float> inputValues( {7, 8, 6, 1,
175  1, 1, 8, 7,
176  3, 7, 7, 7,
177 
178  6, 8, 4, 7,
179  3, 8, 7, 3,
180  5, 8, 8, 8,
181 
182 
183  7, 8, 2, 7,
184  3, 8, 5, 6,
185  8, 4, 2, 7,
186 
187  1, 6, 7, 2,
188  8, 3, 3, 1,
189  7, 6, 2, 6,
190 
191 
192  5, 3, 4, 8,
193  7, 8, 2, 4,
194  6, 6, 2, 8,
195 
196  2, 2, 7, 2,
197  5, 3, 6, 3,
198  6, 1, 8, 8});
199  std::vector<float> outputValues({ 28.0f, 35.0f, 30.0f, 27.0f,
200  27.0f, 31.0f, 31.0f, 24.0f,
201  35.0f, 32.0f, 29.0f, 44.0f});
202 
203  return ReduceTestCommon<ArmnnType>(workloadFactory,
204  memoryManager,
205  tensorHandleFactory,
206  inputTensorInfo,
207  outputTensorInfo,
208  inputValues,
209  outputValues,
210  { 1 },
212 }

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

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

◆ ReduceSumSingleAxisTest3()

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

Definition at line 215 of file ReduceSumTestImpl.cpp.

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

219 {
220  const armnn::TensorShape inputShape{ 1, 6, 3, 4 };
221  const armnn::TensorShape outputShape{ 1, 6, 3, 1};
222 
223  armnn::TensorInfo inputTensorInfo(inputShape, ArmnnType);
224 
225  if (armnn::IsQuantizedType<T>())
226  {
227  inputTensorInfo.SetQuantizationScale(1.0f);
228  inputTensorInfo.SetQuantizationOffset(0);
229  }
230 
231  armnn::TensorInfo outputTensorInfo(outputShape, armnn::DataType::Float32);
232 
233  std::vector<float> inputValues( {7, 8, 6, 1,
234  1, 1, 8, 7,
235  3, 7, 7, 7,
236 
237  6, 8, 4, 7,
238  3, 8, 7, 3,
239  5, 8, 8, 8,
240 
241 
242  7, 8, 2, 7,
243  3, 8, 5, 6,
244  8, 4, 2, 7,
245 
246  1, 6, 7, 2,
247  8, 3, 3, 1,
248  7, 6, 2, 6,
249 
250 
251  5, 3, 4, 8,
252  7, 8, 2, 4,
253  6, 6, 2, 8,
254 
255  2, 2, 7, 2,
256  5, 3, 6, 3,
257  6, 1, 8, 8});
258  std::vector<float> outputValues({ 22.0f, 17.0f, 24.0f,
259  25.0f, 21.0f, 29.0f,
260 
261  24.0f, 22.0f, 21.0f,
262  16.0f, 15.0f, 21.0f,
263 
264  20.0f, 21.0f, 22.0f,
265  13.0f, 17.0f, 23.0f});
266 
267  return ReduceTestCommon<ArmnnType>(workloadFactory,
268  memoryManager,
269  tensorHandleFactory,
270  inputTensorInfo,
271  outputTensorInfo,
272  inputValues,
273  outputValues,
274  { 3 },
276  true);
277 }

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

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