MCPcopy Create free account
hub / github.com/ARM-software/armnn / AddFP32Test

Function AddFP32Test

delegate/test/ElementwiseBinaryTest.cpp:22–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20{
21
22void AddFP32Test()
23{
24 std::vector<int32_t> input0Shape { 2, 2, 2, 3 };
25 std::vector<int32_t> input1Shape { 2, 2, 2, 3 };
26 std::vector<int32_t> expectedOutputShape { 2, 2, 2, 3 };
27
28 std::vector<float> input0Values =
29 {
30 0.0f, 2.0f, 1.0f,
31 0.2f, 1.0f, 2.0f,
32
33 1.0f, 2.0f, 1.0f,
34 0.2f, 1.0f, 2.0f,
35
36 0.0f, 2.0f, 1.0f,
37 4.2f, 1.0f, 2.0f,
38
39 0.0f, 0.0f, 1.0f,
40 0.2f, 1.0f, 2.0f,
41 };
42
43 std::vector<float> input1Values =
44 {
45 1.0f, 2.0f, 1.0f,
46 0.0f, 1.0f, 2.0f,
47
48 1.0f, 2.0f, -2.0f,
49 0.2f, 1.0f, 2.0f,
50
51 0.0f, 2.0f, 1.0f,
52 4.2f, 0.0f, -3.0f,
53
54 0.0f, 0.0f, 1.0f,
55 0.7f, 1.0f, 5.0f,
56 };
57
58 std::vector<float> expectedOutputValues =
59 {
60 1.0f, 4.0f, 2.0f,
61 0.2f, 2.0f, 4.0f,
62
63 2.0f, 4.0f, -1.0f,
64 0.4f, 2.0f, 4.0f,
65
66 0.0f, 4.0f, 2.0f,
67 8.4f, 1.0f, -1.0f,
68
69 0.0f, 0.0f, 2.0f,
70 0.9f, 2.0f, 7.0f,
71 };
72
73 ElementwiseBinaryTest<float>(tflite::BuiltinOperator_ADD,
74 tflite::ActivationFunctionType_NONE,
75 ::tflite::TensorType_FLOAT32,
76 input0Shape,
77 input1Shape,
78 expectedOutputShape,
79 input0Values,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected