From f8c4749a463106696ab99b6400b92a858a169a19 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Tue, 4 Feb 2020 17:39:59 +0000 Subject: COMPMID-3083: Add graph support for PRelu Change-Id: I48492f8c48b818b563bba1e0b48831ac5cdf1420 Signed-off-by: Georgios Pinitas Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2685 Comments-Addressed: Arm Jenkins Reviewed-by: Michele Di Giorgio Tested-by: Arm Jenkins --- arm_compute/graph/frontend/Layers.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 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 2b44d0e844..420f715674 100644 --- a/arm_compute/graph/frontend/Layers.h +++ b/arm_compute/graph/frontend/Layers.h @@ -902,6 +902,34 @@ private: PoolingLayerInfo _pool_info; }; +/** PRelu Layer */ +class PReluLayer final : public ILayer +{ +public: + /** Construct an PRelu operation layer + * + * @param[in] sub_stream0 First graph sub-stream + * @param[in] sub_stream1 First graph sub-stream + */ + PReluLayer(SubStream &&sub_stream0, SubStream &&sub_stream1) + : _ss0(std::move(sub_stream0)), _ss1(std::move(sub_stream1)) + { + } + + NodeID create_layer(IStream &s) override + { + NodeParams common_params = { name(), s.hints().target_hint }; + NodeIdxPair input = { _ss0.tail_node(), 0 }; + NodeIdxPair alpha = { _ss1.tail_node(), 0 }; + + return GraphBuilder::add_prelu_node(s.graph(), common_params, input, alpha); + } + +private: + SubStream _ss0; + SubStream _ss1; +}; + /** Print Layer */ class PrintLayer final : public ILayer { -- cgit v1.2.1