| 207 | } |
| 208 | |
| 209 | unsigned int GetNumElementsBetween(const TensorShape& shape, |
| 210 | const unsigned int firstAxisInclusive, |
| 211 | const unsigned int lastAxisExclusive) |
| 212 | { |
| 213 | if (firstAxisInclusive > lastAxisExclusive) |
| 214 | { |
| 215 | throw armnn::InvalidArgumentException(fmt::format( |
| 216 | "GetNumElementsBetween: firstAxisInclusive [{}D] is greater than lastAxisExclusive [{}D]", |
| 217 | firstAxisInclusive, |
| 218 | lastAxisExclusive)); |
| 219 | } |
| 220 | if (lastAxisExclusive > shape.GetNumDimensions()) |
| 221 | { |
| 222 | throw armnn::InvalidArgumentException(fmt::format( |
| 223 | "{}: lastAxisExclusive [{}D] is greater than the number of dimensions of the tensor shape [{}D]" |
| 224 | "GetNumElementsBetween", |
| 225 | lastAxisExclusive, |
| 226 | shape.GetNumDimensions())); |
| 227 | } |
| 228 | unsigned int count = 1; |
| 229 | for (unsigned int i = firstAxisInclusive; i < lastAxisExclusive; i++) |
| 230 | { |
| 231 | count *= shape[i]; |
| 232 | } |
| 233 | return count; |
| 234 | } |
| 235 | |
| 236 | unsigned int GetUnsignedAxis(const unsigned int inputDimension, const int axis) |
| 237 | { |
no test coverage detected