aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/graph/backends/ValidateHelpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute/graph/backends/ValidateHelpers.h')
-rw-r--r--arm_compute/graph/backends/ValidateHelpers.h26
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