| 11 | |
| 12 | namespace { |
| 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 | |
| 33 | namespace armnn |
no test coverage detected