diff options
Diffstat (limited to 'include/armnn')
-rw-r--r-- | include/armnn/Descriptors.hpp | 14 | ||||
-rw-r--r-- | include/armnn/Types.hpp | 44 |
2 files changed, 7 insertions, 51 deletions
diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp index 0abc7583b9..b705abe729 100644 --- a/include/armnn/Descriptors.hpp +++ b/include/armnn/Descriptors.hpp @@ -198,7 +198,7 @@ struct Pooling2dDescriptor uint32_t m_StrideY; OutputShapeRounding m_OutputShapeRounding; PaddingMethod m_PaddingMethod; - DataLayoutIndexed m_DataLayout; + DataLayout m_DataLayout; }; struct FullyConnectedDescriptor @@ -286,7 +286,7 @@ struct L2NormalizationDescriptor : m_DataLayout(DataLayout::NCHW) {} - DataLayoutIndexed m_DataLayout; + DataLayout m_DataLayout; }; struct BatchNormalizationDescriptor @@ -297,7 +297,7 @@ struct BatchNormalizationDescriptor {} float m_Eps; - DataLayoutIndexed m_DataLayout; + DataLayout m_DataLayout; }; struct BatchToSpaceNdDescriptor @@ -316,7 +316,7 @@ struct BatchToSpaceNdDescriptor std::vector<unsigned int> m_BlockShape; std::vector<std::pair<unsigned int, unsigned int>> m_Crops; - DataLayoutIndexed m_DataLayout; + DataLayout m_DataLayout; }; struct FakeQuantizationDescriptor @@ -340,7 +340,7 @@ struct ResizeBilinearDescriptor uint32_t m_TargetWidth; uint32_t m_TargetHeight; - DataLayoutIndexed m_DataLayout; + DataLayout m_DataLayout; }; struct ReshapeDescriptor @@ -371,7 +371,7 @@ struct SpaceToBatchNdDescriptor std::vector<unsigned int> m_BlockShape; std::vector<std::pair<unsigned int, unsigned int>> m_PadList; - DataLayoutIndexed m_DataLayout; + DataLayout m_DataLayout; }; // temporary descriptor for Lstm @@ -455,7 +455,7 @@ struct StridedSliceDescriptor int32_t m_EllipsisMask; int32_t m_NewAxisMask; - DataLayoutIndexed m_DataLayout; + DataLayout m_DataLayout; }; } diff --git a/include/armnn/Types.hpp b/include/armnn/Types.hpp index cd6e17be37..d815005f5b 100644 --- a/include/armnn/Types.hpp +++ b/include/armnn/Types.hpp @@ -31,56 +31,12 @@ enum class DataType Signed32 = 3 }; -// Begin: DataLayout - enum class DataLayout { NCHW = 1, NHWC = 2 }; -// Provides access to the appropriate indexes for Channels, Height and Width based on DataLayout -class DataLayoutIndexed -{ -public: - DataLayoutIndexed(DataLayout dataLayout) : m_DataLayout(dataLayout) - { - switch (dataLayout) - { - case DataLayout::NHWC: - m_ChannelsIndex = 3; - m_HeightIndex = 1; - m_WidthIndex = 2; - break; - case DataLayout::NCHW: - m_ChannelsIndex = 1; - m_HeightIndex = 2; - m_WidthIndex = 3; - break; - default: - throw InvalidArgumentException("Unknown DataLayout value: " + - std::to_string(static_cast<int>(dataLayout))); - } - } - - DataLayout GetDataLayout() const { return m_DataLayout; } - unsigned int GetChannelsIndex() const { return m_ChannelsIndex; } - unsigned int GetHeightIndex() const { return m_HeightIndex; } - unsigned int GetWidthIndex() const { return m_WidthIndex; } - -private: - DataLayout m_DataLayout; - unsigned int m_ChannelsIndex; - unsigned int m_HeightIndex; - unsigned int m_WidthIndex; -}; - -// Conversion methods - implementations in src/armnn/InternalTypes.cpp -bool operator==(const DataLayout& dataLayout, const DataLayoutIndexed& indexed); -bool operator==(const DataLayoutIndexed& indexed, const DataLayout& dataLayout); - -// End: DataLayout - enum class ActivationFunction { Sigmoid = 0, |