| 10 | namespace armnnDelegate { |
| 11 | |
| 12 | void PreluFloatSimpleTest(bool isAlphaConst, bool isDynamicOutput = false) |
| 13 | { |
| 14 | std::vector<int32_t> inputShape { 1, 2, 3 }; |
| 15 | std::vector<int32_t> alphaShape { 1 }; |
| 16 | std::vector<int32_t> outputShape { 1, 2, 3 }; |
| 17 | |
| 18 | if (isDynamicOutput) |
| 19 | { |
| 20 | outputShape.clear(); |
| 21 | } |
| 22 | |
| 23 | std::vector<float> inputData = { -14.f, 2.f, 0.f, 1.f, -5.f, 14.f }; |
| 24 | std::vector<float> alphaData = { 0.5f }; |
| 25 | std::vector<float> expectedOutput = { -7.f, 2.f, 0.f, 1.f, -2.5f, 14.f }; |
| 26 | |
| 27 | PreluTest(tflite::BuiltinOperator_PRELU, |
| 28 | ::tflite::TensorType_FLOAT32, |
| 29 | inputShape, |
| 30 | alphaShape, |
| 31 | outputShape, |
| 32 | inputData, |
| 33 | alphaData, |
| 34 | expectedOutput, |
| 35 | isAlphaConst); |
| 36 | } |
| 37 | |
| 38 | TEST_SUITE("PreluTests") |
| 39 | { |
no test coverage detected