From a9cca6aa935b3e290181a05fdb2c5f5557a49c09 Mon Sep 17 00:00:00 2001 From: Derek Lamberti Date: Mon, 25 Mar 2019 15:41:58 +0000 Subject: IVGCVSW-2870 Support QuantizeLayer on frontend Change-Id: I2014a8d801f1f222d27a80dddf4f188ddcb3a5c9 Signed-off-by: Derek Lamberti --- include/armnn/ILayerSupport.hpp | 4 ++++ include/armnn/ILayerVisitor.hpp | 6 ++++++ include/armnn/INetwork.hpp | 5 +++++ include/armnn/LayerVisitorBase.hpp | 3 +++ 4 files changed, 18 insertions(+) (limited to 'include/armnn') diff --git a/include/armnn/ILayerSupport.hpp b/include/armnn/ILayerSupport.hpp index 7896a80a8f..76d9c10d7f 100644 --- a/include/armnn/ILayerSupport.hpp +++ b/include/armnn/ILayerSupport.hpp @@ -209,6 +209,10 @@ public: const PreCompiledDescriptor& descriptor, Optional reasonIfUnsupported = EmptyOptional()) const = 0; + virtual bool IsQuantizeSupported(const TensorInfo& input, + const TensorInfo& output, + Optional reasonIfUnsupported = EmptyOptional()) const = 0; + virtual bool IsReshapeSupported(const TensorInfo& input, const ReshapeDescriptor& descriptor, Optional reasonIfUnsupported = EmptyOptional()) const = 0; diff --git a/include/armnn/ILayerVisitor.hpp b/include/armnn/ILayerVisitor.hpp index ce09246d07..76027f6eed 100644 --- a/include/armnn/ILayerVisitor.hpp +++ b/include/armnn/ILayerVisitor.hpp @@ -281,6 +281,12 @@ public: const PadDescriptor& padDescriptor, const char* name = nullptr) = 0; + /// Function a quantize 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 VisitQuantizeLayer(const IConnectableLayer* layer, + const char* name = nullptr) = 0; + /// Function a strided 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 StridedSliceDescriptor - Parameters for the strided slice operation. diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp index b61206fae1..7c1fbdbd49 100644 --- a/include/armnn/INetwork.hpp +++ b/include/armnn/INetwork.hpp @@ -353,6 +353,11 @@ public: virtual IConnectableLayer* AddPadLayer(const PadDescriptor& padDescriptor, const char* name = nullptr) = 0; + /// Add a quantize layer to the network + ///@param name - Optional name for the layer. + /// @return - Interface for configuring the layer. + virtual IConnectableLayer* AddQuantizeLayer(const char* name = nullptr) = 0; + /// Adds a strided slice layer to the network. /// @param StridedSliceDescriptor - Parameters for the strided slice operation. /// @param name - Optional name for the layer. diff --git a/include/armnn/LayerVisitorBase.hpp b/include/armnn/LayerVisitorBase.hpp index 2c37a21786..d30005f0ed 100644 --- a/include/armnn/LayerVisitorBase.hpp +++ b/include/armnn/LayerVisitorBase.hpp @@ -151,6 +151,9 @@ public: const PadDescriptor&, const char*) override { DefaultPolicy::Apply(); } + void VisitQuantizeLayer(const IConnectableLayer*, + const char*) override { DefaultPolicy::Apply(); } + void VisitStridedSliceLayer(const IConnectableLayer*, const StridedSliceDescriptor&, const char*) override { DefaultPolicy::Apply(); } -- cgit v1.2.1