MCPcopy Create free account
hub / github.com/ARM-software/armnn / GetNumElementsAfter

Function GetNumElementsAfter

src/armnnUtils/TensorUtils.cpp:261–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261unsigned int GetNumElementsAfter(const armnn::TensorShape& shape, unsigned int axis)
262{
263 unsigned int numDim = shape.GetNumDimensions();
264 if (axis >= numDim)
265 {
266 throw armnn::InvalidArgumentException(fmt::format(
267 "{}: axis index [{}D] indexes beyond the number of dimesions of the tensor shape [{}D]",
268 "GetNumElementsAfter",
269 axis,
270 numDim));
271 }
272 unsigned int count = 1;
273 for (unsigned int i = axis+1; i < numDim; i++)
274 {
275 count *= shape[i];
276 }
277 return count;
278}
279
280std::pair<unsigned int, std::vector<float>> GetPerAxisParams(const armnn::TensorInfo& info)
281{

Callers 3

GetPerAxisParamsFunction · 0.85
ToFloatArrayFunction · 0.85
PerAxisIteratorMethod · 0.85

Calls 3

formatEnum · 0.85
GetNumDimensionsMethod · 0.45

Tested by

no test coverage detected