From 5d7b0a314b3e354a6cbcf15f5dd78b50f1e02774 Mon Sep 17 00:00:00 2001 From: Matthew Sloyan Date: Mon, 18 Oct 2021 13:07:49 +0100 Subject: Add ConstTensorsAsInput support for Conv3d * Constant weights and biases are now stored as Constant layers. * Updated Serializer, Deserializer and unit tests to reflect this. * Updated TfLiteParser. * Updated Ref backend to handle constant weights and bias as inputs rather than reading from member variables. * Added Conv3d EndToEnd test. * Added NCDHW DataLayout and unit tests. Signed-off-by: Matthew Sloyan Change-Id: I10cdd354ca5f1c748730f92ffdb36bf810f83c8e --- include/armnn/Descriptors.hpp | 5 ++++- include/armnn/INetwork.hpp | 4 ---- include/armnn/Types.hpp | 3 ++- include/armnn/TypesUtils.hpp | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp index b412bbdcc9..39ea824045 100644 --- a/include/armnn/Descriptors.hpp +++ b/include/armnn/Descriptors.hpp @@ -498,6 +498,9 @@ struct Convolution3dDescriptor : BaseDescriptor m_DataLayout == rhs.m_DataLayout; } + /// Get the number of views/inputs. + uint32_t GetNumInputs() const; + /// Padding left value in the width dimension. uint32_t m_PadLeft; /// Padding right value in the width dimension. @@ -524,7 +527,7 @@ struct Convolution3dDescriptor : BaseDescriptor uint32_t m_DilationZ; /// Enable/disable bias. bool m_BiasEnabled; - /// The data layout to be used (NDHWC). + /// The data layout to be used (NDHWC, NCDHW). DataLayout m_DataLayout; }; diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp index ab92f05112..707ae00bb3 100644 --- a/include/armnn/INetwork.hpp +++ b/include/armnn/INetwork.hpp @@ -258,13 +258,9 @@ public: /// Adds a 3D convolution layer to the network. /// @param convolution3dDescriptor - Description of the 3D convolution layer. - /// @param weights - Tensor for the weights data. - /// @param biases - Optional tensor for the bias data. If specified, must match the output tensor shape. /// @param name - Optional name for the layer. /// @return - Interface for configuring the layer. IConnectableLayer* AddConvolution3dLayer(const Convolution3dDescriptor& convolution3dDescriptor, - const ConstTensor& weights, - const Optional& biases, const char* name = nullptr); /// Adds a depth to space layer to the network. diff --git a/include/armnn/Types.hpp b/include/armnn/Types.hpp index 7f2e192102..4f39ebe16a 100644 --- a/include/armnn/Types.hpp +++ b/include/armnn/Types.hpp @@ -50,7 +50,8 @@ enum class DataLayout { NCHW = 1, NHWC = 2, - NDHWC = 3 + NDHWC = 3, + NCDHW = 4 }; /// Define the behaviour of the internal profiler when outputting network details diff --git a/include/armnn/TypesUtils.hpp b/include/armnn/TypesUtils.hpp index d08f592d86..a1c11b74df 100644 --- a/include/armnn/TypesUtils.hpp +++ b/include/armnn/TypesUtils.hpp @@ -215,6 +215,7 @@ constexpr const char* GetDataLayoutName(DataLayout dataLayout) case DataLayout::NCHW: return "NCHW"; case DataLayout::NHWC: return "NHWC"; case DataLayout::NDHWC: return "NDHWC"; + case DataLayout::NCDHW: return "NCDHW"; default: return "Unknown"; } } -- cgit v1.2.1