diff options
author | Michele Di Giorgio <michele.digiorgio@arm.com> | 2018-09-12 17:44:08 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:54:54 +0000 |
commit | c30b668bf7b3e7f841ea8ef9295f43fc69519e15 (patch) | |
tree | bc83c9b8bb0893cae23780907b6cf370b721d7b3 /arm_compute/graph/frontend/Layers.h | |
parent | 17220e2eb49e75b85f2b802489a44b8019997c25 (diff) | |
download | ComputeLibrary-c30b668bf7b3e7f841ea8ef9295f43fc69519e15.tar.gz |
COMPMID-1576: Add SliceLayer to graph API
Change-Id: I42260cc529ca7721e221d3d0576b1668e09f8307
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/148255
Tested-by: bsgcomp <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute/graph/frontend/Layers.h')
-rw-r--r-- | arm_compute/graph/frontend/Layers.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arm_compute/graph/frontend/Layers.h b/arm_compute/graph/frontend/Layers.h index bbfda9ca82..3a45115d7c 100644 --- a/arm_compute/graph/frontend/Layers.h +++ b/arm_compute/graph/frontend/Layers.h @@ -718,6 +718,32 @@ private: ITensorAccessorUPtr _add_w; }; +/** Slice Layer */ +class SliceLayer final : public ILayer +{ +public: + /** Construct a slice layer. + * + * @param[in] starts The starts of the dimensions of the input tensor to be sliced. The length must be of rank(input). + * @param[in] ends The ends of the dimensions of the input tensor to be sliced. The length must be of rank(input). + */ + SliceLayer(Coordinates &starts, Coordinates &ends) + : _starts(starts), _ends(ends) + { + } + + NodeID create_layer(IStream &s) override + { + NodeParams common_params = { name(), s.hints().target_hint }; + NodeIdxPair input = { s.tail_node(), 0 }; + return GraphBuilder::add_slice_node(s.graph(), common_params, input, _starts, _ends); + } + +private: + Coordinates _starts; + Coordinates _ends; +}; + /** Softmax Layer */ class SoftmaxLayer final : public ILayer { |