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

Function ReducedOutputOffset

src/backends/reference/workloads/Reduce.cpp:40–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40unsigned 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
70void Reduce(const TensorInfo& inputInfo,

Callers 1

ReduceFunction · 0.85

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected