From d2048ce58a88853cee6cdd67fe0d6f09c3e212b0 Mon Sep 17 00:00:00 2001 From: Manuel Bottini Date: Tue, 23 Oct 2018 17:00:42 +0100 Subject: COMPMID-1638 - Add BBoxTransform to the graph API Change-Id: I67cbbce59d61d907fc4dc4c3997e96b347dfe895 --- arm_compute/graph/frontend/Layers.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 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 d72f549cf9..fa0656dcdc 100644 --- a/arm_compute/graph/frontend/Layers.h +++ b/arm_compute/graph/frontend/Layers.h @@ -154,6 +154,41 @@ private: float _epsilon; }; +/** Bounding Box Transform Layer */ +class BoundingBoxTransformLayer final : public ILayer +{ +public: + /** Construct a bounding box transform layer. + * + * @param[in] sub_stream_input Graph sub-stream for the input + * @param[in] sub_stream_deltas Graph sub-stream for the deltas + * @param[in] info Contains BoundingBox operation information described in @ref BoundingBoxTransformInfo. + */ + BoundingBoxTransformLayer(SubStream &&sub_stream_input, SubStream &&sub_stream_deltas, BoundingBoxTransformInfo info) + : _ss_input(sub_stream_input), _ss_deltas(sub_stream_deltas), _bbox_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 input = { _ss_input.tail_node(), 0 }; + NodeIdxPair deltas = { _ss_deltas.tail_node(), 0 }; + return GraphBuilder::add_bounding_box_transform_node(s.graph(), common_params, input, deltas, _bbox_info); + } + +private: + SubStream _ss_input; + SubStream _ss_deltas; + BoundingBoxTransformInfo _bbox_info; +}; + /** Channel Shuffle Layer */ class ChannelShuffleLayer final : public ILayer { -- cgit v1.2.1