aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2019-06-11 14:14:03 +0100
committerÁron Virginás-Tar <aron.virginas-tar@arm.com>2019-06-12 08:53:33 +0000
commit972af1568372f243f241b58fa07f0d3a7f991d1e (patch)
tree7f00157cc66bef8ced30a8e0a0f5e5305a82111f /include
parente9e1878cb94e45ba71303a8ceda5bc523997fde4 (diff)
downloadarmnn-972af1568372f243f241b58fa07f0d3a7f991d1e.tar.gz
IVGCVSW-3258 Add front end support for new SpaceToDepth layer
Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> Change-Id: Id677e29a734f2b36483d939ad370079bdc11551e
Diffstat (limited to 'include')
-rw-r--r--include/armnn/Descriptors.hpp16
-rw-r--r--include/armnn/DescriptorsFwd.hpp1
-rw-r--r--include/armnn/ILayerSupport.hpp5
-rw-r--r--include/armnn/ILayerVisitor.hpp8
-rw-r--r--include/armnn/INetwork.hpp7
-rw-r--r--include/armnn/LayerSupport.hpp8
-rw-r--r--include/armnn/LayerVisitorBase.hpp4
7 files changed, 48 insertions, 1 deletions
diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp
index 25bf818987..9479db3571 100644
--- a/include/armnn/Descriptors.hpp
+++ b/include/armnn/Descriptors.hpp
@@ -540,6 +540,20 @@ struct SpaceToBatchNdDescriptor
DataLayout m_DataLayout;
};
+/// A SpaceToDepthDescriptor for the SpaceToDepthLayer
+struct SpaceToDepthDescriptor
+{
+ SpaceToDepthDescriptor()
+ : m_BlockSize(1u)
+ , m_DataLayout(DataLayout::NHWC)
+ {}
+
+ /// Scalar specifying the input block size. It must be >= 1
+ unsigned int m_BlockSize;
+ /// The data layout to be used (NCHW, NHWC).
+ DataLayout m_DataLayout;
+};
+
/// An LstmDescriptor for the LstmLayer.
struct LstmDescriptor
{
@@ -667,4 +681,4 @@ struct PreCompiledDescriptor
unsigned int m_NumOutputSlots;
};
-}
+} // namespace armnn \ No newline at end of file
diff --git a/include/armnn/DescriptorsFwd.hpp b/include/armnn/DescriptorsFwd.hpp
index 4f47738915..1c75c253ed 100644
--- a/include/armnn/DescriptorsFwd.hpp
+++ b/include/armnn/DescriptorsFwd.hpp
@@ -28,6 +28,7 @@ struct ReshapeDescriptor;
struct ResizeBilinearDescriptor;
struct SoftmaxDescriptor;
struct SpaceToBatchNdDescriptor;
+struct SpaceToDepthDescriptor;
struct StridedSliceDescriptor;
struct ViewsDescriptor;
diff --git a/include/armnn/ILayerSupport.hpp b/include/armnn/ILayerSupport.hpp
index f41495ce1a..4c113d3427 100644
--- a/include/armnn/ILayerSupport.hpp
+++ b/include/armnn/ILayerSupport.hpp
@@ -260,6 +260,11 @@ public:
const SpaceToBatchNdDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
+ virtual bool IsSpaceToDepthSupported(const TensorInfo& input,
+ const TensorInfo& output,
+ const SpaceToDepthDescriptor& descriptor,
+ Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
+
ARMNN_DEPRECATED_MSG("Use IsSplitterSupported with outputs instead")
virtual bool IsSplitterSupported(const TensorInfo& input,
const ViewsDescriptor& descriptor,
diff --git a/include/armnn/ILayerVisitor.hpp b/include/armnn/ILayerVisitor.hpp
index cbddb2d9ac..ab83dbfb05 100644
--- a/include/armnn/ILayerVisitor.hpp
+++ b/include/armnn/ILayerVisitor.hpp
@@ -336,6 +336,14 @@ public:
const SpaceToBatchNdDescriptor& spaceToBatchNdDescriptor,
const char* name = nullptr) = 0;
+ /// Function a space to depth layer should call back to when its Accept(ILayerVisitor&) function is invoked.
+ /// @param layer - pointer to the layer which is calling back to this visit function.
+ /// @param spaceToDepthDescriptor - Parameters for the space to depth operation.
+ /// @param name - Optional name for the layer.
+ virtual void VisitSpaceToDepthLayer(const IConnectableLayer* layer,
+ const SpaceToDepthDescriptor& spaceToDepthDescriptor,
+ const char* name = nullptr) = 0;
+
/// Function that a splitter layer should call back to when its Accept(ILayerVisitor&) function is invoked.
/// @param layer - pointer to the layer which is calling back to this visit function.
/// @param splitterDescriptor - ViewsDescriptor to configure the splitting process.
diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp
index f3dfcd8841..e5ebbc4e44 100644
--- a/include/armnn/INetwork.hpp
+++ b/include/armnn/INetwork.hpp
@@ -328,6 +328,13 @@ public:
virtual IConnectableLayer* AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor& spaceToBatchNdDescriptor,
const char* name = nullptr) = 0;
+ /// Adds a space to depth layer to the network.
+ /// @param spaceToDepthDescriptor - Parameters for the space to depth operation.
+ /// @param name - Optional name for the layer.
+ /// @return - Interface for configuring the layer.
+ virtual IConnectableLayer* AddSpaceToDepthLayer(const SpaceToDepthDescriptor& spaceToDepthDescriptor,
+ const char* name = nullptr) = 0;
+
/// Adds a floor layer to the network.
/// @param name - Optional name for the layer.
/// @return - Interface for configuring the layer.
diff --git a/include/armnn/LayerSupport.hpp b/include/armnn/LayerSupport.hpp
index 0ae8705a5e..d58aa8731a 100644
--- a/include/armnn/LayerSupport.hpp
+++ b/include/armnn/LayerSupport.hpp
@@ -326,6 +326,14 @@ bool IsSpaceToBatchNdSupported(const BackendId& backend,
char* reasonIfUnsupported = nullptr,
size_t reasonIfUnsupportedMaxLength = 1024);
+/// Deprecated in favor of IBackend and ILayerSupport interfaces
+bool IsSpaceToDepthSupported(const BackendId& backend,
+ const TensorInfo& input,
+ const TensorInfo& output,
+ const SpaceToDepthDescriptor& descriptor,
+ char* reasonIfUnsupported = nullptr,
+ size_t reasonIfUnsupportedMaxLength = 1024);
+
ARMNN_DEPRECATED_MSG("Use IsSplitterSupported with outputs instead")
bool IsSplitterSupported(const BackendId& backend,
const TensorInfo& input,
diff --git a/include/armnn/LayerVisitorBase.hpp b/include/armnn/LayerVisitorBase.hpp
index 47a8384924..f1abab56e7 100644
--- a/include/armnn/LayerVisitorBase.hpp
+++ b/include/armnn/LayerVisitorBase.hpp
@@ -173,6 +173,10 @@ public:
const SpaceToBatchNdDescriptor&,
const char*) override { DefaultPolicy::Apply(__func__); }
+ void VisitSpaceToDepthLayer(const IConnectableLayer*,
+ const SpaceToDepthDescriptor&,
+ const char*) override { DefaultPolicy::Apply(__func__); }
+
void VisitSplitterLayer(const IConnectableLayer*,
const ViewsDescriptor&,
const char*) override { DefaultPolicy::Apply(__func__); }