From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- 20.02/_fake_quantization_test_impl_8hpp.xhtml | 174 ++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 20.02/_fake_quantization_test_impl_8hpp.xhtml (limited to '20.02/_fake_quantization_test_impl_8hpp.xhtml') diff --git a/20.02/_fake_quantization_test_impl_8hpp.xhtml b/20.02/_fake_quantization_test_impl_8hpp.xhtml new file mode 100644 index 0000000000..eced7b6feb --- /dev/null +++ b/20.02/_fake_quantization_test_impl_8hpp.xhtml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + +ArmNN: src/backends/backendsCommon/test/layerTests/FakeQuantizationTestImpl.hpp File Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
FakeQuantizationTestImpl.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

LayerTestResult< float, 2 > FakeQuantizationTest (armnn::IWorkloadFactory &workloadFactory, const armnn::IBackendInternal::IMemoryManagerSharedPtr &memoryManager)
 
+

Function Documentation

+ +

◆ FakeQuantizationTest()

+ +
+
+ + + + + + + + + + + + + + + + + + +
LayerTestResult<float, 2> FakeQuantizationTest (armnn::IWorkloadFactoryworkloadFactory,
const armnn::IBackendInternal::IMemoryManagerSharedPtrmemoryManager 
)
+
+ +

Definition at line 16 of file FakeQuantizationTestImpl.cpp.

+ +

References CopyDataFromITensorHandle(), CopyDataToITensorHandle(), IWorkloadFactory::CreateFakeQuantization(), IWorkloadFactory::CreateTensorHandle(), armnn::Float32, armnn::IgnoreUnused(), FakeQuantizationDescriptor::m_Max, FakeQuantizationDescriptor::m_Min, QueueDescriptorWithParameters< LayerDescriptor >::m_Parameters, LayerTestResult< T, n >::output, and LayerTestResult< T, n >::outputExpected.

+
19 {
20  IgnoreUnused(memoryManager);
21  constexpr unsigned int width = 2;
22  constexpr unsigned int height = 3;
23 
24  const armnn::TensorInfo tensorInfo({height, width },
26 
27  auto input = MakeTensor<float, 2>(tensorInfo, std::vector<float>({
28  -10.0f, -5.0f,
29  0.0f, 5.0f,
30  10.0f, 10.0f
31  }));
32 
33  LayerTestResult<float, 2> ret(tensorInfo);
34 
35  std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(tensorInfo);
36  std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(tensorInfo);
37 
40 
41  AddInputToWorkload(data, info, tensorInfo, inputHandle.get());
42  AddOutputToWorkload(data, info, tensorInfo, outputHandle.get());
43 
44  float min = -10.f;
45  float max = 10.f;
46 
47  data.m_Parameters.m_Min = min;
48  data.m_Parameters.m_Max = max;
49 
50  armnn::PassthroughCpuTensorHandle refHandle(tensorInfo, &ret.outputExpected[0][0]);
52  armnn::WorkloadInfo refInfo = info;
53  SetWorkloadOutput(refData, refInfo, 0, tensorInfo, &refHandle);
54 
55  std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateFakeQuantization(data, info);
56 
57  inputHandle->Allocate();
58  outputHandle->Allocate();
59 
60  CopyDataToITensorHandle(inputHandle.get(), &input[0][0]);
61 
62  workload->PostAllocationConfigure();
63  workload->Execute();
64 
65  CopyDataFromITensorHandle(&ret.output[0][0], outputHandle.get());
66 
67  ret.outputExpected = MakeTensor<float, 2>(tensorInfo, std::vector<float>({
68  0.0f, 63.0f,
69  128.0f, 191.0f,
70  255.0f, 255.0f
71  }));
72 
73  return ret;
74 }
+ +
virtual std::unique_ptr< IWorkload > CreateFakeQuantization(const FakeQuantizationQueueDescriptor &descriptor, const WorkloadInfo &info) const
+
void IgnoreUnused(Ts &&...)
+ + +
void CopyDataFromITensorHandle(void *memory, const armnn::ITensorHandle *tensorHandle)
+
virtual std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo, const bool IsMemoryManaged=true) const =0
+ + +
Contains information about inputs and outputs to a layer.
+ + + +
void CopyDataToITensorHandle(armnn::ITensorHandle *tensorHandle, const void *memory)
+
+
+
+
+
+ + + + -- cgit v1.2.1