| 38 | } |
| 39 | |
| 40 | unsigned int ReducedOutputOffset(const unsigned int numDims, |
| 41 | const armnn::TensorShape& dims, |
| 42 | std::vector<unsigned int>& index, |
| 43 | const unsigned int numAxis, |
| 44 | const std::vector<unsigned int>& axis) |
| 45 | { |
| 46 | unsigned int offset = 0; |
| 47 | for (unsigned int idx = 0; idx < numDims; ++idx) |
| 48 | { |
| 49 | bool isAxis = false; |
| 50 | if (!axis.empty()) |
| 51 | { |
| 52 | for (unsigned int axisIdx = 0; axisIdx < numAxis; ++axisIdx) |
| 53 | { |
| 54 | if (idx == axis[axisIdx]) |
| 55 | { |
| 56 | isAxis = true; |
| 57 | break; |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | if (!isAxis) |
| 62 | { |
| 63 | offset = offset * dims[idx] + index[idx]; |
| 64 | } |
| 65 | } |
| 66 | return offset; |
| 67 | } |
| 68 | |
| 69 | |
| 70 | void Reduce(const TensorInfo& inputInfo, |