aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMohamed Nour Abouelseoud <mohamednour.abouelseoud@arm.com>2018-09-24 13:30:09 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2018-10-10 16:16:57 +0100
commit5662c206864df4121eea29c541c24c0f62113809 (patch)
treef80aa8a094dc3ede6d2c7e4a905ac2f278199268 /include
parent351d13d0b5fa698b72130012b2f069d30b911cb3 (diff)
downloadarmnn-5662c206864df4121eea29c541c24c0f62113809.tar.gz
IVGCVSW-1881 Add PadLayer to ArmNN
Change-Id: Ib70883a20fa7b82bfb090aa98cc51a6d645b5722
Diffstat (limited to 'include')
-rw-r--r--include/armnn/Descriptors.hpp7
-rw-r--r--include/armnn/DescriptorsFwd.hpp1
-rw-r--r--include/armnn/INetwork.hpp9
-rw-r--r--include/armnn/LayerSupport.hpp7
4 files changed, 23 insertions, 1 deletions
diff --git a/include/armnn/Descriptors.hpp b/include/armnn/Descriptors.hpp
index dfd532f633..7fd36d5873 100644
--- a/include/armnn/Descriptors.hpp
+++ b/include/armnn/Descriptors.hpp
@@ -351,7 +351,12 @@ struct MeanDescriptor
struct PadDescriptor
{
- PadDescriptor(const std::vector<std::pair<unsigned int, unsigned int>>& padList);
+ PadDescriptor()
+ {}
+
+ PadDescriptor(const std::vector<std::pair<unsigned int, unsigned int>>& padList)
+ : m_PadList(padList)
+ {}
// first is number of values to add before the tensor in the dimension,
// second is the number of values to add after the tensor in the dimension
diff --git a/include/armnn/DescriptorsFwd.hpp b/include/armnn/DescriptorsFwd.hpp
index b161df8827..9cb3463b28 100644
--- a/include/armnn/DescriptorsFwd.hpp
+++ b/include/armnn/DescriptorsFwd.hpp
@@ -16,6 +16,7 @@ struct LstmDescriptor;
struct PermuteDescriptor;
struct NormalizationDescriptor;
struct MeanDescriptor;
+struct PadDescriptor;
struct Pooling2dDescriptor;
struct ReshapeDescriptor;
struct ResizeBilinearDescriptor;
diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp
index 7fd7a25b60..1d2679aabb 100644
--- a/include/armnn/INetwork.hpp
+++ b/include/armnn/INetwork.hpp
@@ -285,6 +285,15 @@ public:
/// @ return - Interface for configuring the layer.
virtual IConnectableLayer* AddMeanLayer(const MeanDescriptor& meanDescriptor, const char* name = nullptr) = 0;
+ /// Adds a fully pad layer to the network.
+ /// @param paddings - n by 2 tensor, where n is the rank of the input tensor,
+ /// such that paddings[i,0] indicates the amount of padding to add in front of dimonsion i, and
+ /// paddings[i,1] indicates the amount of padding to add after the end of dimension i
+ /// @param name - Optional name for the layer.
+ /// @return - Interface for configuring the layer.
+ virtual IConnectableLayer* AddPadLayer(const PadDescriptor& padDescriptor,
+ const char* name = nullptr) = 0;
+
protected:
~INetwork() {}
};
diff --git a/include/armnn/LayerSupport.hpp b/include/armnn/LayerSupport.hpp
index d00691fad1..3c7cce5c64 100644
--- a/include/armnn/LayerSupport.hpp
+++ b/include/armnn/LayerSupport.hpp
@@ -203,4 +203,11 @@ bool IsMeanSupported(Compute compute,
char* reasonIfUnsupported = nullptr,
size_t reasonIfUnsupportedMaxLength = 1024);
+bool IsPadSupported(Compute compute,
+ const TensorInfo& input,
+ const TensorInfo& output,
+ const PadDescriptor& descriptor,
+ char* reasonIfUnsupported = nullptr,
+ size_t reasonIfUnsupportedMaxLength = 1024);
+
}