From e4294fd7363fd2f5a7be25d1722f20ed935d3445 Mon Sep 17 00:00:00 2001 From: Nattapat Chaimanowong Date: Thu, 28 Mar 2019 09:56:53 +0000 Subject: IVGCVSW-2874 Add DequantizeLayer and no-op factory method *Add Dequantize layer to the frontend *Add Serializer and Deserializer for Dequantize Change-Id: Ide2647b9e0348d599deb97e61ca4bf66e2f17fc0 Signed-off-by: Nattapat Chaimanowong --- include/armnn/ILayerSupport.hpp | 4 ++++ include/armnn/ILayerVisitor.hpp | 7 +++++++ include/armnn/INetwork.hpp | 4 ++++ include/armnn/LayerSupport.hpp | 7 +++++++ include/armnn/LayerVisitorBase.hpp | 4 +++- 5 files changed, 25 insertions(+), 1 deletion(-) (limited to 'include/armnn') diff --git a/include/armnn/ILayerSupport.hpp b/include/armnn/ILayerSupport.hpp index 4794a219e7..fe440719b0 100644 --- a/include/armnn/ILayerSupport.hpp +++ b/include/armnn/ILayerSupport.hpp @@ -77,6 +77,10 @@ public: const Optional& biases, Optional reasonIfUnsupported = EmptyOptional()) const = 0; + virtual bool IsDequantizeSupported(const TensorInfo& input, + const TensorInfo& output, + Optional reasonIfUnsupported = EmptyOptional()) const = 0; + virtual bool IsDetectionPostProcessSupported( const TensorInfo& input0, const TensorInfo& input1, diff --git a/include/armnn/ILayerVisitor.hpp b/include/armnn/ILayerVisitor.hpp index a39cbd10b9..e23cf5e6dd 100644 --- a/include/armnn/ILayerVisitor.hpp +++ b/include/armnn/ILayerVisitor.hpp @@ -95,6 +95,13 @@ public: const Optional& biases, const char* name = nullptr) = 0; + /// Function that a Dequantize 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 name - Optional name for the layer. + virtual void VisitDequantizeLayer(const IConnectableLayer* layer, + const char* name = nullptr) = 0; + /// Function that a Detection PostProcess 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 7c1fbdbd49..5a9d4f246e 100644 --- a/include/armnn/INetwork.hpp +++ b/include/armnn/INetwork.hpp @@ -147,6 +147,10 @@ public: const ConstTensor& biases, const char* name = nullptr) = 0; + /// Adds a Dequantize layer to the network. + /// @return - Interface for configuring the layer. + virtual IConnectableLayer* AddDequantizeLayer(const char* name = nullptr) = 0; + /// Adds a Detection PostProcess layer to the network. /// @param descriptor - Description of the Detection PostProcess layer. /// @param anchors - Tensor for anchors. diff --git a/include/armnn/LayerSupport.hpp b/include/armnn/LayerSupport.hpp index 7b9343b5d6..7c6bc1372a 100644 --- a/include/armnn/LayerSupport.hpp +++ b/include/armnn/LayerSupport.hpp @@ -95,6 +95,13 @@ bool IsDepthwiseConvolutionSupported(const BackendId& backend, char* reasonIfUnsupported = nullptr, size_t reasonIfUnsupportedMaxLength = 1024); +/// Deprecated in favor of IBackend and ILayerSupport interfaces +bool IsDequantizeSupported(const BackendId& backend, + const TensorInfo& input, + const TensorInfo& output, + char* reasonIfUnsupported = nullptr, + size_t reasonIfUnsupportedMaxLength = 1024); + /// Deprecated in favor of IBackend and ILayerSupport interfaces bool IsDivisionSupported(const BackendId& backend, const TensorInfo& input0, diff --git a/include/armnn/LayerVisitorBase.hpp b/include/armnn/LayerVisitorBase.hpp index d30005f0ed..a5459e1a32 100644 --- a/include/armnn/LayerVisitorBase.hpp +++ b/include/armnn/LayerVisitorBase.hpp @@ -45,6 +45,9 @@ public: const Optional&, const char*) override { DefaultPolicy::Apply(); } + void VisitDequantizeLayer(const IConnectableLayer*, + const char*) override { DefaultPolicy::Apply(); } + void VisitDetectionPostProcessLayer(const IConnectableLayer*, const DetectionPostProcessDescriptor&, const ConstTensor&, @@ -175,4 +178,3 @@ public: }; } //namespace armnn - -- cgit v1.2.1