| 161 | } |
| 162 | |
| 163 | void L2NormalizationTest(const std::vector<armnn::BackendId>& backends = {}) |
| 164 | { |
| 165 | // Set input data |
| 166 | std::vector<int32_t> inputShape { 1, 1, 1, 10 }; |
| 167 | std::vector<int32_t> outputShape { 1, 1, 1, 10 }; |
| 168 | |
| 169 | std::vector<float> inputValues |
| 170 | { |
| 171 | 1.0f, |
| 172 | 2.0f, |
| 173 | 3.0f, |
| 174 | 4.0f, |
| 175 | 5.0f, |
| 176 | 6.0f, |
| 177 | 7.0f, |
| 178 | 8.0f, |
| 179 | 9.0f, |
| 180 | 10.0f |
| 181 | }; |
| 182 | |
| 183 | const float approxInvL2Norm = 0.050964719f; |
| 184 | std::vector<float> expectedOutputValues |
| 185 | { |
| 186 | 1.0f * approxInvL2Norm, |
| 187 | 2.0f * approxInvL2Norm, |
| 188 | 3.0f * approxInvL2Norm, |
| 189 | 4.0f * approxInvL2Norm, |
| 190 | 5.0f * approxInvL2Norm, |
| 191 | 6.0f * approxInvL2Norm, |
| 192 | 7.0f * approxInvL2Norm, |
| 193 | 8.0f * approxInvL2Norm, |
| 194 | 9.0f * approxInvL2Norm, |
| 195 | 10.0f * approxInvL2Norm |
| 196 | }; |
| 197 | |
| 198 | NormalizationTest<float>(tflite::BuiltinOperator_L2_NORMALIZATION, |
| 199 | ::tflite::TensorType_FLOAT32, |
| 200 | inputShape, |
| 201 | outputShape, |
| 202 | inputValues, |
| 203 | expectedOutputValues, |
| 204 | backends); |
| 205 | } |
| 206 | |
| 207 | void LocalResponseNormalizationTest(int32_t radius, |
| 208 | float bias, |
no outgoing calls
no test coverage detected