ArmNN
 20.05
MeanTestImpl.hpp File Reference

Go to the source code of this file.

Functions

template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 1 > MeanSimpleTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 3 > MeanSimpleAxisTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > MeanKeepDimsTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 4 > MeanMultipleDimsTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 1 > MeanVts1Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 3 > MeanVts2Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>>
LayerTestResult< T, 3 > MeanVts3Test (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 

Function Documentation

◆ MeanKeepDimsTest()

LayerTestResult<T, 4> MeanKeepDimsTest ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager 
)

Definition at line 106 of file MeanTestImpl.hpp.

109 {
110  const unsigned int inputShape[] = { 1, 1, 3, 2 };
111  const unsigned int outputShape[] = { 1, 1, 1, 2 };
112 
113  std::vector<float> input({ 1.5f, 1.5f, 2.5f, 2.5f, 3.5f, 3.5f });
114  std::vector<float> output({ 2.5f, 2.5f });
115 
116  return MeanTestHelper<ArmnnType, T, 4, 4>(
117  workloadFactory, memoryManager, inputShape, input, { 2 }, true, outputShape, output);
118 }

◆ MeanMultipleDimsTest()

LayerTestResult<T, 4> MeanMultipleDimsTest ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager 
)

Definition at line 121 of file MeanTestImpl.hpp.

124 {
125  const unsigned int inputShape[] = { 2, 3, 1, 2 };
126  const unsigned int outputShape[] = { 1, 3, 1, 1 };
127 
128  std::vector<float> input({ 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5f, 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5 });
129  std::vector<float> output({ 2.0f, 4.0f, 6.0f });
130 
131  return MeanTestHelper<ArmnnType, T, 4, 4>(
132  workloadFactory, memoryManager, inputShape, input, { 0, 3 }, true, outputShape, output);
133 }

◆ MeanSimpleAxisTest()

LayerTestResult<T, 3> MeanSimpleAxisTest ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager 
)

Definition at line 91 of file MeanTestImpl.hpp.

94 {
95  const unsigned int inputShape[] = { 2, 3, 1, 2 };
96  const unsigned int outputShape[] = { 3, 1, 2 };
97 
98  std::vector<float> input({ 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5f, 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5f });
99  std::vector<float> output({ 1.5f, 2.5f, 3.5f, 4.5f, 5.5f, 6.5f });
100 
101  return MeanTestHelper<ArmnnType, T, 4, 3>(
102  workloadFactory, memoryManager, inputShape, input, { 0 }, false, outputShape, output);
103 }

◆ MeanSimpleTest()

LayerTestResult<T, 1> MeanSimpleTest ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager 
)

Definition at line 76 of file MeanTestImpl.hpp.

79 {
80  const unsigned int inputShape[] = { 3, 2 };
81  const unsigned int outputShape[] = { 1 };
82 
83  std::vector<float> input({ 1.5f, 1.5f, 2.5f, 2.5f, 3.5f, 3.5f });
84  std::vector<float> output({ 2.5f });
85 
86  return MeanTestHelper<ArmnnType, T, 2, 1>(
87  workloadFactory, memoryManager, inputShape, input, {}, false, outputShape, output);
88 }

◆ MeanVts1Test()

LayerTestResult<T, 1> MeanVts1Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager 
)

Definition at line 136 of file MeanTestImpl.hpp.

139 {
140  const unsigned int inputShape[] = { 4, 3, 2 };
141  const unsigned int outputShape[] = { 2 };
142 
143  std::vector<float> input({ 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f,
144  15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f });
145  std::vector<float> output({ 12.0f, 13.0f });
146 
147  return MeanTestHelper<ArmnnType, T, 3, 1>(
148  workloadFactory, memoryManager, inputShape, input, { 0, 1 }, false, outputShape, output);
149 }

◆ MeanVts2Test()

LayerTestResult<T, 3> MeanVts2Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager 
)

Definition at line 152 of file MeanTestImpl.hpp.

155 {
156  const unsigned int inputShape[] = { 4, 3, 2 };
157  const unsigned int outputShape[] = { 1, 3, 1 };
158 
159  std::vector<float> input({ 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f,
160  15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f });
161  std::vector<float> output({ 10.5f, 12.5f, 14.5f });
162 
163  return MeanTestHelper<ArmnnType, T, 3, 3>(
164  workloadFactory, memoryManager, inputShape, input, { 0, 2 }, true, outputShape, output);
165 }

◆ MeanVts3Test()

LayerTestResult<T, 3> MeanVts3Test ( armnn::IWorkloadFactory workloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtr memoryManager 
)

Definition at line 168 of file MeanTestImpl.hpp.

171 {
172  const unsigned int inputShape[] = { 1, 2, 2, 1 };
173  const unsigned int outputShape[] = { 1, 2, 1 };
174 
175  std::vector<float> input({ 1.0f, 2.0f, 3.0f, 4.0f });
176  std::vector<float> output({ 1.5f, 3.5f });
177 
178  return MeanTestHelper<ArmnnType, T, 4, 3>(
179  workloadFactory, memoryManager, inputShape, input, { 2 }, false, outputShape, output);
180 }