diff options
Diffstat (limited to 'include/armnn')
-rw-r--r-- | include/armnn/Descriptors.hpp | 19 | ||||
-rw-r--r-- | include/armnn/DescriptorsFwd.hpp | 1 | ||||
-rw-r--r-- | include/armnn/ILayerSupport.hpp | 5 | ||||
-rw-r--r-- | include/armnn/INetwork.hpp | 7 | ||||
-rw-r--r-- | include/armnn/LayerSupport.hpp | 8 |
5 files changed, 40 insertions, 0 deletions
diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp index 656afb1756..bda8cf7396 100644 --- a/include/armnn/Descriptors.hpp +++ b/include/armnn/Descriptors.hpp @@ -296,6 +296,25 @@ struct BatchNormalizationDescriptor DataLayoutIndexed m_DataLayout; }; +struct BatchToSpaceNdDescriptor +{ + BatchToSpaceNdDescriptor() + : m_BlockShape() + , m_Crops() + , m_DataLayout(DataLayout::NCHW) + {} + + BatchToSpaceNdDescriptor(std::vector<unsigned int> blockShape, std::vector<std::vector<unsigned int>> crops) + : m_BlockShape(blockShape) + , m_Crops(crops) + , m_DataLayout(DataLayout::NCHW) + {} + + std::vector<unsigned int> m_BlockShape; + std::vector<std::vector<unsigned int>> m_Crops; + DataLayoutIndexed m_DataLayout; +}; + struct FakeQuantizationDescriptor { FakeQuantizationDescriptor() diff --git a/include/armnn/DescriptorsFwd.hpp b/include/armnn/DescriptorsFwd.hpp index a2974d797d..0e96c360d3 100644 --- a/include/armnn/DescriptorsFwd.hpp +++ b/include/armnn/DescriptorsFwd.hpp @@ -8,6 +8,7 @@ namespace armnn { struct ActivationDescriptor; struct BatchNormalizationDescriptor; +struct BatchToSpaceNdDescriptor; struct Convolution2dDescriptor; struct DepthwiseConvolution2dDescriptor; struct FakeQuantizationDescriptor; diff --git a/include/armnn/ILayerSupport.hpp b/include/armnn/ILayerSupport.hpp index 0e7adff0af..1bf268f409 100644 --- a/include/armnn/ILayerSupport.hpp +++ b/include/armnn/ILayerSupport.hpp @@ -41,6 +41,11 @@ public: const BatchNormalizationDescriptor& descriptor, Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; + virtual bool IsBatchToSpaceNdSupported(const TensorInfo& input, + const TensorInfo& output, + const BatchToSpaceNdDescriptor& descriptor, + Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; + virtual bool IsConstantSupported(const TensorInfo& output, Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const; diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp index 2cb8f28d87..df274d6dc1 100644 --- a/include/armnn/INetwork.hpp +++ b/include/armnn/INetwork.hpp @@ -149,6 +149,13 @@ public: virtual IConnectableLayer* AddPermuteLayer(const PermuteDescriptor& permuteDescriptor, const char* name = nullptr) = 0; + /// Adds a batch to space ND layer to the network. + /// @param batchToSpaceNdDescriptor - Description of the layer. + /// @param name - Optional name for the layer. + /// @return - Interface for configuring the layer. + virtual IConnectableLayer* AddBatchToSpaceNdLayer(const BatchToSpaceNdDescriptor& batchToSpaceNdDescriptor, + const char* name = nullptr) = 0; + /// Adds a pooling layer to the network. /// @param pooling2dDescriptor - Pooling2dDescriptor to configure the pooling. /// @param name - Optional name for the layer. diff --git a/include/armnn/LayerSupport.hpp b/include/armnn/LayerSupport.hpp index eb6b5da7b9..bd20f185da 100644 --- a/include/armnn/LayerSupport.hpp +++ b/include/armnn/LayerSupport.hpp @@ -41,6 +41,14 @@ bool IsBatchNormalizationSupported(const BackendId& backend, size_t reasonIfUnsupportedMaxLength = 1024); /// Deprecated in favor of IBackend and ILayerSupport interfaces +bool IsBatchToSpaceNdSupported(const BackendId& backend, + const TensorInfo& input, + const TensorInfo& output, + const BatchToSpaceNdDescriptor& descriptor, + char* reasonIfUnsupported = nullptr, + size_t reasonIfUnsupportedMaxLength = 1024); + +/// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsConstantSupported(const BackendId& backend, const TensorInfo& output, char* reasonIfUnsupported = nullptr, |