diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/armnn/Descriptors.hpp | 20 | ||||
-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 | 10 | ||||
-rw-r--r-- | include/armnn/LayerVisitorBase.hpp | 4 |
6 files changed, 45 insertions, 3 deletions
diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp index e871e89ebb..8d382f700e 100644 --- a/include/armnn/Descriptors.hpp +++ b/include/armnn/Descriptors.hpp @@ -667,6 +667,24 @@ struct PadDescriptor float m_PadValue; }; +/// A SliceDescriptor for the SliceLayer. +struct SliceDescriptor +{ + SliceDescriptor(const std::vector<unsigned int>& begin, const std::vector<unsigned int>& size) + : m_Begin(begin) + , m_Size(size) + {} + + SliceDescriptor() : SliceDescriptor({}, {}) + {} + + /// Beginning indices of the slice in each dimension. + std::vector<unsigned int> m_Begin; + + /// Size of the slice in each dimension. + std::vector<unsigned int> m_Size; +}; + /// A StackDescriptor for the StackLayer. struct StackDescriptor { @@ -786,4 +804,4 @@ struct TransposeConvolution2dDescriptor DataLayout m_DataLayout; }; -} // namespace armnn
\ No newline at end of file +} // namespace armnn diff --git a/include/armnn/DescriptorsFwd.hpp b/include/armnn/DescriptorsFwd.hpp index 8f81b4fe3e..bddb0cad59 100644 --- a/include/armnn/DescriptorsFwd.hpp +++ b/include/armnn/DescriptorsFwd.hpp @@ -31,6 +31,7 @@ struct ResizeDescriptor; struct SoftmaxDescriptor; struct SpaceToBatchNdDescriptor; struct SpaceToDepthDescriptor; +struct SliceDescriptor; struct StackDescriptor; struct StridedSliceDescriptor; struct TransposeConvolution2dDescriptor; diff --git a/include/armnn/ILayerSupport.hpp b/include/armnn/ILayerSupport.hpp index d168226402..cab2df19af 100644 --- a/include/armnn/ILayerSupport.hpp +++ b/include/armnn/ILayerSupport.hpp @@ -269,6 +269,11 @@ public: const TensorInfo& output, Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; + virtual bool IsSliceSupported(const TensorInfo& input, + const TensorInfo& output, + const SliceDescriptor& descriptor, + Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0; + virtual bool IsSoftmaxSupported(const TensorInfo& input, const TensorInfo& output, const SoftmaxDescriptor& descriptor, diff --git a/include/armnn/ILayerVisitor.hpp b/include/armnn/ILayerVisitor.hpp index a504a4190d..6c0977303c 100644 --- a/include/armnn/ILayerVisitor.hpp +++ b/include/armnn/ILayerVisitor.hpp @@ -357,6 +357,14 @@ public: virtual void VisitRsqrtLayer(const IConnectableLayer* layer, const char* name = nullptr) = 0; + /// Function that a slice 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 sliceDescriptor - SliceDescriptor to configure the slice operation. + /// @param name - Optional name for the layer. + virtual void VisitSliceLayer(const IConnectableLayer* layer, + const SliceDescriptor& sliceDescriptor, + const char* name = nullptr) = 0; + /// Function that a softmax 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. diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp index cd1b7a6319..09026ad9e6 100644 --- a/include/armnn/INetwork.hpp +++ b/include/armnn/INetwork.hpp @@ -237,6 +237,12 @@ public: virtual IConnectableLayer* AddNormalizationLayer(const NormalizationDescriptor& normalizationDescriptor, const char* name = nullptr) = 0; + /// Adds a slice layer to the network. + /// @param sliceDescriptor - SliceDescriptor to configure the slice operation. + /// @param name - Optional name for the layer. + /// @return - Interface for configuring the layer. + virtual IConnectableLayer* AddSliceLayer(const SliceDescriptor& sliceDescriptor, const char* name = nullptr) = 0; + /// Adds a softmax layer to the network. /// If the data type is QAsymm8, then the output quantization parameters /// must have a scale of 1/256 and an offset of 0 @@ -253,8 +259,8 @@ public: /// the first output, second view to the second output, etc.... /// @param name - Optional name for the layer. /// @return - Interface for configuring the layer. - virtual IConnectableLayer* AddSplitterLayer(const ViewsDescriptor& splitterDescriptor - , const char* name = nullptr) = 0; + virtual IConnectableLayer* AddSplitterLayer(const ViewsDescriptor& splitterDescriptor, + const char* name = nullptr) = 0; /// Adds a merge layer to the network. /// @param name - Optional name for the layer. diff --git a/include/armnn/LayerVisitorBase.hpp b/include/armnn/LayerVisitorBase.hpp index 0739b43736..d626c712ba 100644 --- a/include/armnn/LayerVisitorBase.hpp +++ b/include/armnn/LayerVisitorBase.hpp @@ -182,6 +182,10 @@ public: void VisitRsqrtLayer(const IConnectableLayer*, const char*) override { DefaultPolicy::Apply(__func__); } + void VisitSliceLayer(const IConnectableLayer*, + const SliceDescriptor&, + const char*) override { DefaultPolicy::Apply(__func__); } + void VisitSoftmaxLayer(const IConnectableLayer*, const SoftmaxDescriptor&, const char*) override { DefaultPolicy::Apply(__func__); } |