ArmNN
 20.08
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 108 of file MeanTestImpl.hpp.

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

◆ MeanMultipleDimsTest()

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

Definition at line 123 of file MeanTestImpl.hpp.

126 {
127  const unsigned int inputShape[] = { 2, 3, 1, 2 };
128  const unsigned int outputShape[] = { 1, 3, 1, 1 };
129 
130  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 });
131  std::vector<float> output({ 2.0f, 4.0f, 6.0f });
132 
133  return MeanTestHelper<ArmnnType, T, 4, 4>(
134  workloadFactory, memoryManager, inputShape, input, { 0, 3 }, true, outputShape, output);
135 }

◆ MeanSimpleAxisTest()

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

Definition at line 93 of file MeanTestImpl.hpp.

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

◆ MeanSimpleTest()

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

Definition at line 78 of file MeanTestImpl.hpp.

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

◆ MeanVts1Test()

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

Definition at line 138 of file MeanTestImpl.hpp.

141 {
142  const unsigned int inputShape[] = { 4, 3, 2 };
143  const unsigned int outputShape[] = { 2 };
144 
145  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,
146  15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f });
147  std::vector<float> output({ 12.0f, 13.0f });
148 
149  return MeanTestHelper<ArmnnType, T, 3, 1>(
150  workloadFactory, memoryManager, inputShape, input, { 0, 1 }, false, outputShape, output);
151 }

◆ MeanVts2Test()

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

Definition at line 154 of file MeanTestImpl.hpp.

157 {
158  const unsigned int inputShape[] = { 4, 3, 2 };
159  const unsigned int outputShape[] = { 1, 3, 1 };
160 
161  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,
162  15.0f, 16.0f, 17.0f, 18.0f, 19.0f, 20.0f, 21.0f, 22.0f, 23.0f, 24.0f });
163  std::vector<float> output({ 10.5f, 12.5f, 14.5f });
164 
165  return MeanTestHelper<ArmnnType, T, 3, 3>(
166  workloadFactory, memoryManager, inputShape, input, { 0, 2 }, true, outputShape, output);
167 }

◆ MeanVts3Test()

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

Definition at line 170 of file MeanTestImpl.hpp.

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