diff options
author | Matthew Sloyan <matthew.sloyan@arm.com> | 2021-09-08 13:05:51 +0100 |
---|---|---|
committer | Matthew Sloyan <matthew.sloyan@arm.com> | 2021-10-01 15:27:01 +0100 |
commit | b63a31170aee1d28267d83a4bc67b57708fb6b05 (patch) | |
tree | 16cea0a872939be749b72f45ad125964439bc40e /src/armnn/Network.cpp | |
parent | eb852bb9e45b1db42a26001ece11ec7cc1f2bbfe (diff) | |
download | armnn-b63a31170aee1d28267d83a4bc67b57708fb6b05.tar.gz |
IVGCVSW-6163 Add Conv3d FrontEnd and Ref Implementation
* Added front-end
* Added Reference workload
* Added Serializer & Deserializer support
* Added unit tests
* Added NDHWC DataLayout
Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com>
Change-Id: Iec4d39e7433b5334d52fa44cf8efc6bcd39319d8
Diffstat (limited to 'src/armnn/Network.cpp')
-rw-r--r-- | src/armnn/Network.cpp | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/src/armnn/Network.cpp b/src/armnn/Network.cpp index 84097176e7..4070802be8 100644 --- a/src/armnn/Network.cpp +++ b/src/armnn/Network.cpp @@ -113,6 +113,15 @@ IConnectableLayer* INetwork::AddConvolution2dLayer(const Convolution2dDescriptor } +IConnectableLayer* INetwork::AddConvolution3dLayer(const Convolution3dDescriptor& convolution3dDescriptor, + const ConstTensor& weights, + const Optional<ConstTensor>& biases, + const char* name) +{ + return pNetworkImpl->AddConvolution3dLayer(convolution3dDescriptor, weights, biases, name); +} + + IConnectableLayer* INetwork::AddDepthToSpaceLayer(const DepthToSpaceDescriptor& depthToSpaceDescriptor, const char* name) { @@ -1991,22 +2000,21 @@ IConnectableLayer* NetworkImpl::AddConvolution2dLayer(const Convolution2dDescrip return AddConvolution2dLayerImpl(convolution2dDescriptor, weights, optionalBiases, name); } -IConnectableLayer* NetworkImpl::AddDepthwiseConvolution2dLayerImpl( - const DepthwiseConvolution2dDescriptor& convolution2dDescriptor, - const ConstTensor& weights, - const Optional<ConstTensor>& biases, - const char* name) +IConnectableLayer* NetworkImpl::AddConvolution3dLayer(const Convolution3dDescriptor& convolution3dDescriptor, + const ConstTensor& weights, + const Optional<ConstTensor>& biases, + const char* name) { - if (convolution2dDescriptor.m_BiasEnabled && !biases.has_value()) + if (convolution3dDescriptor.m_BiasEnabled && !biases.has_value()) { - throw InvalidArgumentException("AddDepthwiseConvolution2dLayer: biases cannot be empty"); + throw InvalidArgumentException("AddConvolution2dLayer: biases cannot be empty"); } - const auto layer = m_Graph->AddLayer<DepthwiseConvolution2dLayer>(convolution2dDescriptor, name); + const auto layer = m_Graph->AddLayer<Convolution3dLayer>(convolution3dDescriptor, name); layer->m_Weight = std::make_shared<ScopedTensorHandle>(weights); - if (convolution2dDescriptor.m_BiasEnabled) + if (convolution3dDescriptor.m_BiasEnabled) { layer->m_Bias = std::make_shared<ScopedTensorHandle>(biases.value()); } @@ -2020,6 +2028,29 @@ IConnectableLayer* NetworkImpl::AddDepthToSpaceLayer(const DepthToSpaceDescripto return m_Graph->AddLayer<DepthToSpaceLayer>(depthToSpaceDescriptor, name); } +IConnectableLayer* NetworkImpl::AddDepthwiseConvolution2dLayerImpl( + const DepthwiseConvolution2dDescriptor& convolution2dDescriptor, + const ConstTensor& weights, + const Optional<ConstTensor>& biases, + const char* name) +{ + if (convolution2dDescriptor.m_BiasEnabled && !biases.has_value()) + { + throw InvalidArgumentException("AddDepthwiseConvolution2dLayer: biases cannot be empty"); + } + + const auto layer = m_Graph->AddLayer<DepthwiseConvolution2dLayer>(convolution2dDescriptor, name); + + layer->m_Weight = std::make_shared<ScopedTensorHandle>(weights); + + if (convolution2dDescriptor.m_BiasEnabled) + { + layer->m_Bias = std::make_shared<ScopedTensorHandle>(biases.value()); + } + + return layer; +} + IConnectableLayer* NetworkImpl::AddDepthwiseConvolution2dLayer( const DepthwiseConvolution2dDescriptor& convolution2dDescriptor, const ConstTensor& weights, |