diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-02-04 17:39:59 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-02-05 16:03:21 +0000 |
commit | f8c4749a463106696ab99b6400b92a858a169a19 (patch) | |
tree | 86d711d5bf25ef3b3a8288ba2aa0b25c2da61091 /arm_compute/graph/backends/ValidateHelpers.h | |
parent | 55a687d5e2cf3434e4c2564ac73959dcc7163304 (diff) | |
download | ComputeLibrary-f8c4749a463106696ab99b6400b92a858a169a19.tar.gz |
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>
Diffstat (limited to 'arm_compute/graph/backends/ValidateHelpers.h')
-rw-r--r-- | arm_compute/graph/backends/ValidateHelpers.h | 26 |
1 files changed, 25 insertions, 1 deletions
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 <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 |