aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDerek Lamberti <derek.lamberti@arm.com>2019-10-21 10:46:16 +0100
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-10-21 12:59:23 +0000
commit013c390c2d9829fede2d8b1d59c3f2a497730462 (patch)
tree7918e1e4e3445a741695772864d200b3979dd1f8 /include
parente80ebd101b516751a798aa1b1d669e9117a32266 (diff)
downloadarmnn-013c390c2d9829fede2d8b1d59c3f2a497730462.tar.gz
IVGCVSW-4009 StandInLayer frontend API
Change-Id: I058c57b554769799c6775813215070ef47790e3d Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
Diffstat (limited to 'include')
-rw-r--r--include/armnn/Descriptors.hpp16
-rw-r--r--include/armnn/DescriptorsFwd.hpp1
-rw-r--r--include/armnn/ILayerSupport.hpp6
-rw-r--r--include/armnn/ILayerVisitor.hpp8
-rw-r--r--include/armnn/INetwork.hpp10
-rw-r--r--include/armnn/LayerVisitorBase.hpp4
6 files changed, 45 insertions, 0 deletions
diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp
index 10d8ab7a08..425c5261df 100644
--- a/include/armnn/Descriptors.hpp
+++ b/include/armnn/Descriptors.hpp
@@ -952,6 +952,22 @@ struct StackDescriptor
TensorShape m_InputShape;
};
+/// A StandInDescriptor for the StandIn layer
+struct StandInDescriptor
+{
+ StandInDescriptor() {};
+
+ StandInDescriptor(uint32_t numInputs, uint32_t numOutputs)
+ : m_NumInputs(numInputs)
+ , m_NumOutputs(numOutputs)
+ {}
+
+ /// Number of input tensors
+ uint32_t m_NumInputs = 0;
+ /// Number of output tensors
+ uint32_t m_NumOutputs = 0;
+};
+
/// A StridedSliceDescriptor for the StridedSliceLayer.
struct StridedSliceDescriptor
{
diff --git a/include/armnn/DescriptorsFwd.hpp b/include/armnn/DescriptorsFwd.hpp
index a978f7739a..cfdef8a030 100644
--- a/include/armnn/DescriptorsFwd.hpp
+++ b/include/armnn/DescriptorsFwd.hpp
@@ -36,6 +36,7 @@ struct SpaceToBatchNdDescriptor;
struct SpaceToDepthDescriptor;
struct SliceDescriptor;
struct StackDescriptor;
+struct StandInDescriptor;
struct StridedSliceDescriptor;
struct TransposeConvolution2dDescriptor;
struct ViewsDescriptor;
diff --git a/include/armnn/ILayerSupport.hpp b/include/armnn/ILayerSupport.hpp
index 87197eed5a..54f4a2883b 100644
--- a/include/armnn/ILayerSupport.hpp
+++ b/include/armnn/ILayerSupport.hpp
@@ -328,6 +328,12 @@ public:
const StackDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
+ virtual bool IsStandInSupported(const std::vector<const TensorInfo*>& inputs,
+ const std::vector<const TensorInfo*>& outputs,
+ const StandInDescriptor& descriptor,
+ Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const = 0;
+
+
virtual bool IsStridedSliceSupported(const TensorInfo& input,
const TensorInfo& output,
const StridedSliceDescriptor& descriptor,
diff --git a/include/armnn/ILayerVisitor.hpp b/include/armnn/ILayerVisitor.hpp
index 80931ebcc0..9669b3a7cb 100644
--- a/include/armnn/ILayerVisitor.hpp
+++ b/include/armnn/ILayerVisitor.hpp
@@ -443,6 +443,14 @@ public:
const StackDescriptor& stackDescriptor,
const char* name = nullptr) = 0;
+ /// Function a StandInLayer should call back to when its Accept(ILaterVisitor&) function is invoked
+ /// @param layer - pointer to the layer which is calling back to this visit function.
+ /// @param standInDescriptor - Parameters for the stand-in layer.
+ /// @param name - Optional name for the layer.
+ virtual void VisitStandInLayer(const IConnectableLayer* layer,
+ const StandInDescriptor& standInDescriptor,
+ 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 b3fab82cb4..10414923e8 100644
--- a/include/armnn/INetwork.hpp
+++ b/include/armnn/INetwork.hpp
@@ -507,6 +507,16 @@ public:
virtual IConnectableLayer* AddStackLayer(const StackDescriptor& descriptor,
const char* name = nullptr) = 0;
+
+ /// Add a stand-in layer for a type unknown to the Arm NN framework.
+ /// Note: Due to the nature of this layer, no validation can be performed by the framework.
+ /// Furthermore, Any model containing this layer cannot make use of dynamic tensors since the
+ /// tensor sizes cannot be inferred.
+ /// @descriptor - Descriptor for the StandIn layer.
+ /// @return - Interface for configuring the layer.
+ virtual IConnectableLayer* AddStandInLayer(const StandInDescriptor& descriptor,
+ const char* name = nullptr) = 0;
+
/// Add a QuantizedLstm layer to the network
/// @param params - The weights and biases for the Quantized LSTM cell
/// @param name - Optional name for the layer
diff --git a/include/armnn/LayerVisitorBase.hpp b/include/armnn/LayerVisitorBase.hpp
index 5226fa2f66..388fc6f922 100644
--- a/include/armnn/LayerVisitorBase.hpp
+++ b/include/armnn/LayerVisitorBase.hpp
@@ -222,6 +222,10 @@ public:
const StackDescriptor&,
const char*) override { DefaultPolicy::Apply(__func__); }
+ void VisitStandInLayer(const IConnectableLayer*,
+ const StandInDescriptor&,
+ const char*) override { DefaultPolicy::Apply(__func__); }
+
void VisitStridedSliceLayer(const IConnectableLayer*,
const StridedSliceDescriptor&,
const char*) override { DefaultPolicy::Apply(__func__); }