| 82 | } |
| 83 | |
| 84 | void AddBroadcastTest() |
| 85 | { |
| 86 | std::vector<int32_t> input0Shape { 1, 3, 2, 1 }; |
| 87 | std::vector<int32_t> input1Shape { 1, 1, 2, 3 }; |
| 88 | std::vector<int32_t> expectedOutputShape { 1, 3, 2, 3 }; |
| 89 | |
| 90 | std::vector<float> input0Values |
| 91 | { |
| 92 | 0.0f, |
| 93 | 1.0f, |
| 94 | |
| 95 | 2.0f, |
| 96 | 3.0f, |
| 97 | |
| 98 | 4.0f, |
| 99 | 5.0f, |
| 100 | }; |
| 101 | std::vector<float> input1Values |
| 102 | { |
| 103 | 0.5f, 1.5f, 2.5f, |
| 104 | 3.5f, 4.5f, 5.5f, |
| 105 | }; |
| 106 | // Set output data |
| 107 | std::vector<float> expectedOutputValues |
| 108 | { |
| 109 | 0.5f, 1.5f, 2.5f, |
| 110 | 4.5f, 5.5f, 6.5f, |
| 111 | |
| 112 | 2.5f, 3.5f, 4.5f, |
| 113 | 6.5f, 7.5f, 8.5f, |
| 114 | |
| 115 | 4.5f, 5.5f, 6.5f, |
| 116 | 8.5f, 9.5f, 10.5f, |
| 117 | }; |
| 118 | |
| 119 | ElementwiseBinaryTest<float>(tflite::BuiltinOperator_ADD, |
| 120 | tflite::ActivationFunctionType_NONE, |
| 121 | ::tflite::TensorType_FLOAT32, |
| 122 | input0Shape, |
| 123 | input1Shape, |
| 124 | expectedOutputShape, |
| 125 | input0Values, |
| 126 | input1Values, |
| 127 | expectedOutputValues); |
| 128 | } |
| 129 | |
| 130 | void AddConstInputTest() |
| 131 | { |
no outgoing calls
no test coverage detected