diff options
author | Michele Di Giorgio <michele.digiorgio@arm.com> | 2018-11-13 12:04:25 +0000 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2018-11-15 13:43:01 +0000 |
commit | 47e6fede687a301137cef25ff729e68d099d4520 (patch) | |
tree | d4f7044fef8cd065c2378d671fc2c39e84dc19a8 /arm_compute/graph/frontend | |
parent | 80a2990b9e0d2eba7962e83d0e9379cd7e307c7d (diff) | |
download | ComputeLibrary-47e6fede687a301137cef25ff729e68d099d4520.tar.gz |
COMPMID-1639: Add GenerateProposals to the graph API
Change-Id: Icf813a0a87d4a07e180eafdb5fa916b2ea4028d2
Diffstat (limited to 'arm_compute/graph/frontend')
-rw-r--r-- | arm_compute/graph/frontend/Layers.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/arm_compute/graph/frontend/Layers.h b/arm_compute/graph/frontend/Layers.h index fa0656dcdc..56dcd88077 100644 --- a/arm_compute/graph/frontend/Layers.h +++ b/arm_compute/graph/frontend/Layers.h @@ -531,6 +531,12 @@ public: { } + /** 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 }; @@ -549,6 +555,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 { |