diff options
author | thecha01 <theo.charalambous@arm.com> | 2020-07-28 17:28:17 +0100 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2020-08-24 09:32:49 +0000 |
commit | f8e358463b4b612eb958fa2dd7588dbefe9b3e2a (patch) | |
tree | e8754177347fe911799cb6c9815d3e7c4a85f2c8 /arm_compute | |
parent | ebd8fb479aa978c428c54c12be6457a0e635c363 (diff) | |
download | ComputeLibrary-f8e358463b4b612eb958fa2dd7588dbefe9b3e2a.tar.gz |
Add support ElementwiseMax operator in graph API
Signed-off-by: thecha01 <theo.charalambous@arm.com>
Change-Id: I764f1eabb6412350eb719cc755b8777efc7d70a1
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3736
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'arm_compute')
-rw-r--r-- | arm_compute/graph/Types.h | 1 | ||||
-rw-r--r-- | arm_compute/graph/backends/FunctionHelpers.h | 6 | ||||
-rw-r--r-- | arm_compute/graph/backends/ValidateHelpers.h | 4 |
3 files changed, 11 insertions, 0 deletions
diff --git a/arm_compute/graph/Types.h b/arm_compute/graph/Types.h index 3a4d0a6070..65d737c7b2 100644 --- a/arm_compute/graph/Types.h +++ b/arm_compute/graph/Types.h @@ -104,6 +104,7 @@ enum class EltwiseOperation Add, /**< Arithmetic addition */ Sub, /**< Arithmetic subtraction */ Mul, /**< Arithmetic multiplication */ + Max, /**< Arithmetic maximum */ }; /** Supported Unary Element-wise operations */ diff --git a/arm_compute/graph/backends/FunctionHelpers.h b/arm_compute/graph/backends/FunctionHelpers.h index af748341a5..60a03e67b0 100644 --- a/arm_compute/graph/backends/FunctionHelpers.h +++ b/arm_compute/graph/backends/FunctionHelpers.h @@ -798,6 +798,12 @@ std::unique_ptr<IFunction> create_eltwise_layer(EltwiseLayerNode &node) std::string("PixelWiseMultiplication"), input1, input2, output, 1.f, convert_policy, node.rounding_policy(), act_info); } + else if(eltwise_op == EltwiseOperation::Max) + { + std::tie(func, func_name) = create_named_function<typename EltwiseFunctions::Maximum>( + std::string("ElementwiseMaximum"), + input1, input2, output, act_info); + } else { ARM_COMPUTE_ERROR("Unsupported element-wise operation!"); diff --git a/arm_compute/graph/backends/ValidateHelpers.h b/arm_compute/graph/backends/ValidateHelpers.h index c929983834..0aec2aec1c 100644 --- a/arm_compute/graph/backends/ValidateHelpers.h +++ b/arm_compute/graph/backends/ValidateHelpers.h @@ -616,6 +616,10 @@ Status validate_eltwise_Layer(EltwiseLayerNode &node) { return EltwiseLayerFunctions::PixelWiseMultiplication::validate(input1, input2, output, scale, convert_policy, round_policy, act_info); } + else if(eltwise_op == EltwiseOperation::Max) + { + return EltwiseLayerFunctions::ElementwiseMax::validate(input1, input2, output, act_info); + } else { ARM_COMPUTE_ERROR("Unsupported element-wise operation!"); |