aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/graph/frontend/Layers.h
diff options
context:
space:
mode:
authorthecha01 <theo.charalambous@arm.com>2020-08-12 17:25:51 +0100
committerMichele Di Giorgio <michele.digiorgio@arm.com>2020-09-04 15:55:01 +0000
commit2bfadd92d638fd4e7b8b3398ce95f15930749189 (patch)
tree7c4a85890884c468e1e736353577e10ea18bc928 /arm_compute/graph/frontend/Layers.h
parent0a05e6a051e6d9028131de10f00b80bbedf44097 (diff)
downloadComputeLibrary-2bfadd92d638fd4e7b8b3398ce95f15930749189.tar.gz
Add StridedSliceLayerNode to graph API
Signed-off-by: thecha01 <theo.charalambous@arm.com> Change-Id: I6d6fb2b053c74e35a86841621486bc0cd34b12b3 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3911 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/graph/frontend/Layers.h')
-rw-r--r--arm_compute/graph/frontend/Layers.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/arm_compute/graph/frontend/Layers.h b/arm_compute/graph/frontend/Layers.h
index 65100a3bd5..2dd8b31ccf 100644
--- a/arm_compute/graph/frontend/Layers.h
+++ b/arm_compute/graph/frontend/Layers.h
@@ -1333,6 +1333,36 @@ private:
int _axis;
};
+/** StridedSlice Layer */
+class StridedSliceLayer final : public ILayer
+{
+public:
+ /** Construct a strided slice layer.
+ *
+ * @param[in] starts The starts of the dimensions of the input tensor to be sliced. The length must be of rank(input).
+ * @param[in] ends The ends of the dimensions of the input tensor to be sliced. The length must be of rank(input).
+ * @param[in] strides The strides of the dimensions of the input tensor to be sliced. The length must be of rank(input).
+ * @param[in] strided_slice_info Contains masks for the starts, ends and strides
+ */
+ StridedSliceLayer(Coordinates &starts, Coordinates &ends, BiStrides &strides, StridedSliceLayerInfo strided_slice_info)
+ : _starts(starts), _ends(ends), _strides(strides), _info(strided_slice_info)
+ {
+ }
+
+ NodeID create_layer(IStream &s) override
+ {
+ NodeParams common_params = { name(), s.hints().target_hint };
+ NodeIdxPair input = { s.tail_node(), 0 };
+ return GraphBuilder::add_strided_slice_node(s.graph(), common_params, input, _starts, _ends, _strides, _info);
+ }
+
+private:
+ Coordinates _starts;
+ Coordinates _ends;
+ BiStrides _strides;
+ StridedSliceLayerInfo _info;
+};
+
/** Upsample Layer */
class UpsampleLayer final : public ILayer
{