11 #include <boost/assert.hpp> 28 unsigned int batchIndex,
unsigned int channelIndex,
29 unsigned int heightIndex,
unsigned int widthIndex)
const 31 BOOST_ASSERT( batchIndex < shape[0] || ( shape[0] == 0 && batchIndex == 0 ) );
32 BOOST_ASSERT( channelIndex < shape[m_ChannelsIndex] ||
33 ( shape[m_ChannelsIndex] == 0 && channelIndex == 0) );
34 BOOST_ASSERT( heightIndex < shape[m_HeightIndex] ||
35 ( shape[m_HeightIndex] == 0 && heightIndex == 0) );
36 BOOST_ASSERT( widthIndex < shape[m_WidthIndex] ||
37 ( shape[m_WidthIndex] == 0 && widthIndex == 0) );
43 batchIndex *= shape[1] * shape[2] * shape[3];
44 heightIndex *= shape[m_WidthIndex] * shape[m_ChannelsIndex];
45 widthIndex *= shape[m_ChannelsIndex];
50 batchIndex *= shape[1] * shape[2] * shape[3];
51 channelIndex *= shape[m_HeightIndex] * shape[m_WidthIndex];
52 heightIndex *= shape[m_WidthIndex];
58 return batchIndex + channelIndex + heightIndex + widthIndex;
63 unsigned int m_ChannelsIndex;
64 unsigned int m_HeightIndex;
65 unsigned int m_WidthIndex;
armnn::DataLayout GetDataLayout() const
unsigned int GetHeightIndex() const
unsigned int GetWidthIndex() const
bool operator==(const armnn::DataLayout &dataLayout, const DataLayoutIndexed &indexed)
unsigned int GetChannelsIndex() const
DataLayoutIndexed(armnn::DataLayout dataLayout)
unsigned int GetIndex(const armnn::TensorShape &shape, unsigned int batchIndex, unsigned int channelIndex, unsigned int heightIndex, unsigned int widthIndex) const