COMPMID-1556 - Add ReorgLayer to graph API
Change-Id: I50c13b5808f3cceec36b92e7afc027f47ebbdea4
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/147369
Reviewed-by: Michele DiGiorgio <michele.digiorgio@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
diff --git a/arm_compute/graph/frontend/Layers.h b/arm_compute/graph/frontend/Layers.h
index 054410e..9a268d3 100644
--- a/arm_compute/graph/frontend/Layers.h
+++ b/arm_compute/graph/frontend/Layers.h
@@ -589,6 +589,31 @@
PoolingLayerInfo _pool_info;
};
+/** Reorg Layer */
+class ReorgLayer final : public ILayer
+{
+public:
+ /** Construct a reorg layer.
+ *
+ * @param[in] stride Stride value to use for reorganizing the values in the output tensor.
+ * It defines the spatial distance between 2 consecutive pixels in the x and y direction
+ */
+ ReorgLayer(int stride)
+ : _stride(stride)
+ {
+ }
+
+ NodeID create_layer(IStream &s) override
+ {
+ NodeParams common_params = { name(), s.hints().target_hint };
+ NodeIdxPair input = { s.tail_node(), 0 };
+ return GraphBuilder::add_reorg_node(s.graph(), common_params, input, _stride);
+ }
+
+private:
+ int _stride;
+};
+
/** Reshape Layer */
class ReshapeLayer final : public ILayer
{