diff options
author | thecha01 <theo.charalambous@arm.com> | 2020-09-01 14:52:38 +0100 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2020-09-09 08:58:13 +0000 |
commit | 3603aff36444e01083b93e603e8b9b0a254d4911 (patch) | |
tree | 2210c3bd8a76654072a2bfa7b84c9151cafc2eee /arm_compute/graph/backends/ValidateHelpers.h | |
parent | 57f30a9309ff2e5e3b32731a785bf38b01d1fd69 (diff) | |
download | ComputeLibrary-3603aff36444e01083b93e603e8b9b0a254d4911.tar.gz |
Add L2Normalize layer node to Graph API
Signed-off-by: thecha01 <theo.charalambous@arm.com>
Change-Id: I5cd26a8829060563d63d8c53e5148631ee053eca
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3912
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.h | 25 |
1 files changed, 25 insertions, 0 deletions
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 <typename L2NormalizeLayer> +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 |