From ec5f85f85c0195b16c0e7714d1f89f23c75cf2bc Mon Sep 17 00:00:00 2001 From: Manuel Bottini Date: Wed, 13 Feb 2019 16:34:56 +0000 Subject: COMPMID-1999: Add support for GenerateProposals operator in CL Change-Id: Ie08a6874347085f96b00f25bdb605eee7d683c25 Signed-off-by: giuros01 Reviewed-on: https://review.mlplatform.org/719 Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas Reviewed-by: Michalis Spyrou --- arm_compute/graph/frontend/Layers.h | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 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 d10fa7f27a..1a71c89e54 100644 --- a/arm_compute/graph/frontend/Layers.h +++ b/arm_compute/graph/frontend/Layers.h @@ -608,6 +608,44 @@ private: const QuantizationInfo _out_quant_info; }; +/** Generate Proposals Layer */ +class GenerateProposalsLayer final : public ILayer +{ +public: + /** Construct a generate proposals layer. + * + * @param[in] ss_scores Graph sub-stream for the scores. + * @param[in] ss_deltas Graph sub-stream for the deltas. + * @param[in] ss_anchors Graph sub-stream for the anchors. + * @param[in] info Generate Proposals operation information. + */ + GenerateProposalsLayer(SubStream &&ss_scores, SubStream &&ss_deltas, SubStream &&ss_anchors, GenerateProposalsInfo info) + : _ss_scores(std::move(ss_scores)), _ss_deltas(std::move(ss_deltas)), _ss_anchors(std::move(ss_anchors)), _info(info) + { + } + + /** Create layer and add to the given stream. + * + * @param[in] s Stream to add layer to. + * + * @return ID of the created node. + */ + NodeID create_layer(IStream &s) override + { + NodeParams common_params = { name(), s.hints().target_hint }; + NodeIdxPair scores = { _ss_scores.tail_node(), 0 }; + NodeIdxPair deltas = { _ss_deltas.tail_node(), 0 }; + NodeIdxPair anchors = { _ss_anchors.tail_node(), 0 }; + return GraphBuilder::add_generate_proposals_node(s.graph(), common_params, scores, deltas, anchors, _info); + } + +private: + SubStream _ss_scores; + SubStream _ss_deltas; + SubStream _ss_anchors; + GenerateProposalsInfo _info; +}; + /** Normalization Layer */ class NormalizationLayer final : public ILayer { -- cgit v1.2.1