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

Function GetOffset

src/backends/reference/workloads/SpaceToDepth.cpp:13–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12namespace {
13 unsigned int GetOffset(const armnn::TensorShape& shape,
14 unsigned int c,
15 unsigned int h,
16 unsigned int w,
17 unsigned int b,
18 const DataLayoutIndexed& dataLayout)
19 {
20 if (dataLayout.GetDataLayout() == armnn::DataLayout::NHWC)
21 {
22 return ((b * shape[dataLayout.GetHeightIndex()] + h) * shape[dataLayout.GetWidthIndex()] + w) *
23 shape[dataLayout.GetChannelsIndex()] + c;
24 }
25 else
26 {
27 return ((b * shape[dataLayout.GetChannelsIndex()] + c) * shape[dataLayout.GetHeightIndex()] + h) *
28 shape[dataLayout.GetWidthIndex()] + w;
29 }
30 }
31}
32
33namespace armnn

Callers 1

SpaceToDepthFunction · 0.70

Calls 4

GetDataLayoutMethod · 0.80
GetHeightIndexMethod · 0.80
GetWidthIndexMethod · 0.80
GetChannelsIndexMethod · 0.80

Tested by

no test coverage detected