From 4bb17337e8330d01e469dfcb42220fe56b85a59f Mon Sep 17 00:00:00 2001 From: Michele Di Giorgio Date: Wed, 26 Sep 2018 13:56:51 +0100 Subject: COMPMID-1603: Add PadLayer to graph API Change-Id: Ic985ac8b0b09c3a6b3f2d43274af8ce89f8c90dd Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/150313 Reviewed-by: Georgios Pinitas Tested-by: bsgcomp --- arm_compute/graph/frontend/Layers.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'arm_compute/graph/frontend/Layers.h') diff --git a/arm_compute/graph/frontend/Layers.h b/arm_compute/graph/frontend/Layers.h index 9c1ef1e140..d72f549cf9 100644 --- a/arm_compute/graph/frontend/Layers.h +++ b/arm_compute/graph/frontend/Layers.h @@ -569,6 +569,31 @@ private: ITensorAccessorUPtr _std; }; +/** Pad Layer */ +class PadLayer final : public ILayer +{ +public: + /** Construct a pad layer. + * + * @param[in] padding The padding for each spatial dimension of the input tensor. The pair padding[i] + * specifies the front and the end padding in the i-th dimension. + */ + PadLayer(PaddingList padding) + : _padding(padding) + { + } + + NodeID create_layer(IStream &s) override + { + NodeParams common_params = { name(), s.hints().target_hint }; + NodeIdxPair input = { s.tail_node(), 0 }; + return GraphBuilder::add_pad_node(s.graph(), common_params, input, _padding); + } + +private: + PaddingList _padding; +}; + /** Permute Layer */ class PermuteLayer final : public ILayer { -- cgit v1.2.1