| 78 | using Executor = std::function<void(float & accumulated, float kernelSize)>; |
| 79 | |
| 80 | Executor GetExecutor(PoolingAlgorithm algorithm) |
| 81 | { |
| 82 | switch (algorithm) |
| 83 | { |
| 84 | case PoolingAlgorithm::Max: |
| 85 | { |
| 86 | return [](float & /*accumulated*/, float /*kernelSize*/) {}; |
| 87 | } |
| 88 | |
| 89 | case PoolingAlgorithm::Average: |
| 90 | { |
| 91 | return [](float & accumulated, float kernelSize) { |
| 92 | accumulated /= kernelSize; |
| 93 | }; |
| 94 | } |
| 95 | |
| 96 | case PoolingAlgorithm::L2: |
| 97 | { |
| 98 | return [](float & accumulated, float kernelSize) { |
| 99 | accumulated = sqrtf(accumulated / kernelSize); |
| 100 | }; |
| 101 | } |
| 102 | |
| 103 | default: |
| 104 | { |
| 105 | throw armnn::InvalidArgumentException("Unsupported pooling algorithm"); |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | bool OnPaddingOnly(int start, int end, int maxRange) |
| 111 | { |
no test coverage detected