diff options
Diffstat (limited to 'include/armnn')
-rw-r--r-- | include/armnn/Descriptors.hpp | 16 | ||||
-rw-r--r-- | include/armnn/DescriptorsFwd.hpp | 1 | ||||
-rw-r--r-- | include/armnn/ILayerSupport.hpp | 5 | ||||
-rw-r--r-- | include/armnn/ILayerVisitor.hpp | 8 | ||||
-rw-r--r-- | include/armnn/INetwork.hpp | 7 | ||||
-rw-r--r-- | include/armnn/LayerSupport.hpp | 8 | ||||
-rw-r--r-- | include/armnn/LayerVisitorBase.hpp | 4 |
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__); } |