aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNattapat Chaimanowong <nattapat.chaimanowong@arm.com>2018-11-02 10:57:25 +0000
committernattapat.chaimanowong <nattapat.chaimanowong@arm.com>2018-11-02 12:35:59 +0000
commit207ef9a6b8b3ea0afe9a095639f67b5dedd095d7 (patch)
treefb6251cfbc28cc2bfdeb5f8f85cc994672e706eb /include
parent6b9658239d377372523fe49c71fde31701d986e3 (diff)
downloadarmnn-207ef9a6b8b3ea0afe9a095639f67b5dedd095d7.tar.gz
IVGCVSW-2093 Add SpaceToBatchNd layer and corresponding no-op factory implementations
Change-Id: Ibd457f3a2d4342c4d6335bd3c471282a14ab6b14
Diffstat (limited to 'include')
-rw-r--r--include/armnn/Descriptors.hpp18
-rw-r--r--include/armnn/DescriptorsFwd.hpp1
-rw-r--r--include/armnn/ILayerSupport.hpp5
-rw-r--r--include/armnn/INetwork.hpp7
-rw-r--r--include/armnn/LayerSupport.hpp8
5 files changed, 39 insertions, 0 deletions
diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp
index 5a7a647ee7..656afb1756 100644
--- a/include/armnn/Descriptors.hpp
+++ b/include/armnn/Descriptors.hpp
@@ -333,6 +333,24 @@ struct ReshapeDescriptor
TensorShape m_TargetShape;
};
+struct SpaceToBatchNdDescriptor
+{
+ SpaceToBatchNdDescriptor()
+ : m_DataLayout(DataLayout::NCHW)
+ {}
+
+ SpaceToBatchNdDescriptor(const std::vector<unsigned int>& blockShape,
+ const std::vector<std::pair<unsigned int, unsigned int>>& padList)
+ : m_BlockShape(blockShape)
+ , m_PadList(padList)
+ , m_DataLayout(DataLayout::NCHW)
+ {}
+
+ std::vector<unsigned int> m_BlockShape;
+ std::vector<std::pair<unsigned int, unsigned int>> m_PadList;
+ DataLayoutIndexed m_DataLayout;
+};
+
// temporary descriptor for Lstm
struct LstmDescriptor
{
diff --git a/include/armnn/DescriptorsFwd.hpp b/include/armnn/DescriptorsFwd.hpp
index 739c12056c..a2974d797d 100644
--- a/include/armnn/DescriptorsFwd.hpp
+++ b/include/armnn/DescriptorsFwd.hpp
@@ -20,6 +20,7 @@ struct MeanDescriptor;
struct PadDescriptor;
struct Pooling2dDescriptor;
struct ReshapeDescriptor;
+struct SpaceToBatchNdDescriptor;
struct ResizeBilinearDescriptor;
struct SoftmaxDescriptor;
struct OriginsDescriptor;
diff --git a/include/armnn/ILayerSupport.hpp b/include/armnn/ILayerSupport.hpp
index d63c3a7063..0e7adff0af 100644
--- a/include/armnn/ILayerSupport.hpp
+++ b/include/armnn/ILayerSupport.hpp
@@ -161,6 +161,11 @@ public:
virtual bool IsReshapeSupported(const TensorInfo& input,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const;
+ virtual bool IsSpaceToBatchNdSupported(const TensorInfo& input,
+ const TensorInfo& output,
+ const SpaceToBatchNdDescriptor& descriptor,
+ Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const;
+
virtual bool IsResizeBilinearSupported(const TensorInfo& input,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const;
diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp
index 7a809350cb..2cb8f28d87 100644
--- a/include/armnn/INetwork.hpp
+++ b/include/armnn/INetwork.hpp
@@ -252,6 +252,13 @@ public:
virtual IConnectableLayer* AddReshapeLayer(const ReshapeDescriptor& reshapeDescriptor,
const char* name = nullptr) = 0;
+ /// Adds a space to batch layer to the network.
+ /// @param spaceToBatchNdDescriptor - Parameters for the space to batch operation.
+ /// @param name - Optional name for the layer.
+ /// @return - Interface for configuring the layer.
+ virtual IConnectableLayer* AddSpaceToBatchNdLayer(const SpaceToBatchNdDescriptor& spaceToBatchNdDescriptor,
+ 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 281807cf79..eb6b5da7b9 100644
--- a/include/armnn/LayerSupport.hpp
+++ b/include/armnn/LayerSupport.hpp
@@ -196,6 +196,14 @@ bool IsSoftmaxSupported(const BackendId& backend,
size_t reasonIfUnsupportedMaxLength = 1024);
/// Deprecated in favor of IBackend and ILayerSupport interfaces
+bool IsSpaceToBatchNdSupported(const BackendId& backend,
+ const TensorInfo& input,
+ const TensorInfo& output,
+ const SpaceToBatchNdDescriptor& descriptor,
+ char* reasonIfUnsupported = nullptr,
+ size_t reasonIfUnsupportedMaxLength = 1024);
+
+/// Deprecated in favor of IBackend and ILayerSupport interfaces
bool IsSplitterSupported(const BackendId& backend,
const TensorInfo& input,
const ViewsDescriptor& descriptor,