COMPMID-3083: Add graph support for PRelu
Change-Id: I48492f8c48b818b563bba1e0b48831ac5cdf1420
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2685
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
diff --git a/arm_compute/graph/backends/ValidateHelpers.h b/arm_compute/graph/backends/ValidateHelpers.h
index 66de7ad..673caf9 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 @@
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 <typename PReluLayer>
+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