From 3603aff36444e01083b93e603e8b9b0a254d4911 Mon Sep 17 00:00:00 2001 From: thecha01 Date: Tue, 1 Sep 2020 14:52:38 +0100 Subject: Add L2Normalize layer node to Graph API Signed-off-by: thecha01 Change-Id: I5cd26a8829060563d63d8c53e5148631ee053eca Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3912 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Comments-Addressed: Arm Jenkins --- arm_compute/graph/backends/ValidateHelpers.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'arm_compute/graph/backends/ValidateHelpers.h') diff --git a/arm_compute/graph/backends/ValidateHelpers.h b/arm_compute/graph/backends/ValidateHelpers.h index 23f6cc5627..1d5fd92838 100644 --- a/arm_compute/graph/backends/ValidateHelpers.h +++ b/arm_compute/graph/backends/ValidateHelpers.h @@ -343,6 +343,31 @@ Status validate_generate_proposals_layer(GenerateProposalsLayerNode &node) return GenerateProposalsLayer::validate(scores, deltas, anchors, proposals, scores_out, num_valid_proposals, info); } +/** Validates a L2Normalization layer node + * + * @tparam L2Normalization layer type + * + * @param[in] node Node to validate + * + * @return Status + */ +template +Status validate_l2_normalize_layer(L2NormalizeLayerNode &node) +{ + ARM_COMPUTE_LOG_GRAPH_VERBOSE("Validating L2NormalizeLayerNode 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 = detail::get_backing_tensor_info(node.input(0)); + arm_compute::ITensorInfo *output = get_backing_tensor_info(node.output(0)); + int axis = node.axis(); + float epsilon = node.epsilon(); + + // Validate function + return L2NormalizeLayer::validate(input, output, axis, epsilon); +} + /** Validates a NormalizePlanarYUV layer node * * @tparam NormalizePlanarYUVLayer layer type -- cgit v1.2.1