aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/graph/backends/ValidateHelpers.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/backends/ValidateHelpers.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/backends/ValidateHelpers.h')
-rw-r--r--arm_compute/graph/backends/ValidateHelpers.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/arm_compute/graph/backends/ValidateHelpers.h b/arm_compute/graph/backends/ValidateHelpers.h
index 0259bfb930..fcebc5c418 100644
--- a/arm_compute/graph/backends/ValidateHelpers.h
+++ b/arm_compute/graph/backends/ValidateHelpers.h
@@ -556,6 +556,32 @@ Status validate_slice_layer(SliceLayerNode &node)
return SliceLayer::validate(input, output, starts, ends);
}
+/** Validates a Strided Slice layer node
+ *
+ * @tparam StridedSliceLayer Strided Slice layer function type
+ *
+ * @param[in] node Node to validate
+ *
+ * @return Status
+ */
+template <typename StridedSliceLayer>
+Status validate_strided_slice_layer(StridedSliceLayerNode &node)
+{
+ ARM_COMPUTE_LOG_GRAPH_VERBOSE("Validating StridedSlice node with ID : " << node.id() << " and Name: " << node.name() << std::endl);
+ ARM_COMPUTE_RETURN_ERROR_ON(node.num_inputs() != 1);
+ ARM_COMPUTE_RETURN_ERROR_ON(node.num_outputs() != 1);
+
+ // Extract IO and info
+ arm_compute::ITensorInfo *input = get_backing_tensor_info(node.input(0));
+ arm_compute::ITensorInfo *output = get_backing_tensor_info(node.output(0));
+ const Coordinates starts = node.starts();
+ const Coordinates ends = node.ends();
+ const BiStrides strides = node.strides();
+ const StridedSliceLayerInfo info = node.strided_slice_info();
+
+ return StridedSliceLayer::validate(input, output, starts, ends, strides, info.begin_mask(), info.end_mask(), info.shrink_axis_mask());
+}
+
/** Validates a Upsample layer node
*
* @tparam UpsampleLayer Upsample layer type