From f8c4749a463106696ab99b6400b92a858a169a19 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Tue, 4 Feb 2020 17:39:59 +0000 Subject: COMPMID-3083: Add graph support for PRelu Change-Id: I48492f8c48b818b563bba1e0b48831ac5cdf1420 Signed-off-by: Georgios Pinitas Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2685 Comments-Addressed: Arm Jenkins Reviewed-by: Michele Di Giorgio Tested-by: Arm Jenkins --- arm_compute/graph/backends/ValidateHelpers.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (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 66de7ad904..673caf9eac 100644 --- a/arm_compute/graph/backends/ValidateHelpers.h +++ b/arm_compute/graph/backends/ValidateHelpers.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 ARM Limited. + * Copyright (c) 2018-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -369,6 +369,30 @@ Status validate_permute_layer(PermuteLayerNode &node) return PermuteLayer::validate(input, output, perm); } + +/** Validates a PRelu layer node + * + * @tparam PReluLayer PRelu layer type + * + * @param[in] node Node to validate + * + * @return Status + */ +template +Status validate_prelu_layer(PReluLayerNode &node) +{ + ARM_COMPUTE_LOG_GRAPH_VERBOSE("Validating PRelu node with ID : " << node.id() << " and Name: " << node.name() << std::endl); + ARM_COMPUTE_RETURN_ERROR_ON(node.num_inputs() != 2); + 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 *alpha = get_backing_tensor_info(node.input(1)); + arm_compute::ITensorInfo *output = get_backing_tensor_info(node.output(0)); + + return PReluLayer::validate(input, alpha, output); +} + /** Validates a priorbox layer node * * @tparam PriorBoxLayer PriorBox layer type -- cgit v1.2.1