diff options
author | Pablo Tello <pablo.tello@arm.com> | 2019-04-26 17:58:13 +0100 |
---|---|---|
committer | Pablo Tello <pablo.tello@arm.com> | 2019-05-13 16:51:35 +0100 |
commit | f0bd68386cc8598f702b1df2d1ba60094e6a9d97 (patch) | |
tree | 4e5a0d2f58bbd7fb095f24bee8932970d14e52a8 /src/backends/reference | |
parent | 3f9119a115bfaaf0ad89a46d00e7b9da844aca22 (diff) | |
download | armnn-f0bd68386cc8598f702b1df2d1ba60094e6a9d97.tar.gz |
MLCE-101: Adding dilation support in conv and dconv
Added support for dilation in DepthwiseConvolution2d in the
Neon and CL backends.
Change-Id: Ie1522b498c07f80d6efcf9dc79e926c8cfa06ca5
Signed-off-by: Pablo Tello <pablo.tello@arm.com>
Diffstat (limited to 'src/backends/reference')
-rw-r--r-- | src/backends/reference/RefLayerSupport.cpp | 24 | ||||
-rw-r--r-- | src/backends/reference/RefLayerSupport.hpp | 8 |
2 files changed, 31 insertions, 1 deletions
diff --git a/src/backends/reference/RefLayerSupport.cpp b/src/backends/reference/RefLayerSupport.cpp index 8eded84e09..a1d8e7de81 100644 --- a/src/backends/reference/RefLayerSupport.cpp +++ b/src/backends/reference/RefLayerSupport.cpp @@ -429,7 +429,29 @@ bool RefLayerSupport::IsDetectionPostProcessSupported(const armnn::TensorInfo& i &TrueFunc<>); } -bool RefLayerSupport::IsDivisionSupported(const TensorInfo& input0, +bool RefLayerSupport::IsDilatedDepthwiseConvolutionSupported(const TensorInfo& input, + const TensorInfo& output, + const DepthwiseConvolution2dDescriptor& descriptor, + const TensorInfo& weights, + const Optional<TensorInfo>& biases, + Optional<std::string&> reasonIfUnsupported) const +{ + if (descriptor.m_DilationY == 1 && descriptor.m_DilationY == 1) + { + return IsDepthwiseConvolutionSupported(input, output, descriptor, weights, biases, reasonIfUnsupported); + } + else + { + if (reasonIfUnsupported) + { + reasonIfUnsupported.value() = "Reference Depthwise Convolution: Dilation parameters must be 1"; + } + return false; + } +} + + + bool RefLayerSupport::IsDivisionSupported(const TensorInfo& input0, const TensorInfo& input1, const TensorInfo& output, Optional<std::string&> reasonIfUnsupported) const diff --git a/src/backends/reference/RefLayerSupport.hpp b/src/backends/reference/RefLayerSupport.hpp index 53a1abf150..9b1a95cdcd 100644 --- a/src/backends/reference/RefLayerSupport.hpp +++ b/src/backends/reference/RefLayerSupport.hpp @@ -74,6 +74,14 @@ public: const DetectionPostProcessDescriptor& descriptor, Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override; + bool IsDilatedDepthwiseConvolutionSupported(const TensorInfo& input, + const TensorInfo& output, + const DepthwiseConvolution2dDescriptor& descriptor, + const TensorInfo& weights, + const Optional<TensorInfo>& biases, + Optional<std::string&> reasonIfUnsupported = + EmptyOptional()) const override; + bool IsDivisionSupported(const TensorInfo& input0, const TensorInfo& input1, const TensorInfo& output, |