From 797b76b1aef38ea3be6f68ae2bf323048e9beff8 Mon Sep 17 00:00:00 2001 From: Sang-Hoon Park Date: Wed, 11 Mar 2020 23:21:14 +0000 Subject: COMPMID-3221: Add EltwiseLayerDescriptor A new descriptor struct for EltwiseLayerNode is added to have better extendability. Change-Id: I3d0a4b3cec1f2425f39157cee6b5c344336412a3 Signed-off-by: Sang-Hoon Park Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2876 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio --- arm_compute/graph/LayerDescriptors.h | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'arm_compute/graph/LayerDescriptors.h') diff --git a/arm_compute/graph/LayerDescriptors.h b/arm_compute/graph/LayerDescriptors.h index 94074e550e..af69682fa3 100644 --- a/arm_compute/graph/LayerDescriptors.h +++ b/arm_compute/graph/LayerDescriptors.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 ARM Limited. + * Copyright (c) 2019-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -21,10 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef ARM_COMPUTE_CONCAT_DESCRIPTOR_H -#define ARM_COMPUTE_CONCAT_DESCRIPTOR_H +#ifndef ARM_COMPUTE_LAYER_DESCRIPTORS_H +#define ARM_COMPUTE_LAYER_DESCRIPTORS_H #include "arm_compute/core/Types.h" +#include "arm_compute/graph/Types.h" namespace arm_compute { @@ -63,7 +64,29 @@ struct ConcatLayerDescriptor const DataLayoutDimension axis; /**< Concatenation Axis */ const QuantizationInfo output_qinfo; /**< Output quantizazion info */ }; + +/** Elementwise layer descriptor */ +struct EltwiseLayerDescriptor +{ + /** Constructor + * + * @param[in] op Element-wise operation to perform + * @param[in] out_quant_info (Optional) Output quantization information. Defaults to empty @ref QuantizationInfo + * @param[in] c_policy (Optional) Convert policy used for the operation. Defaults to @ref ConvertPolicy::SATURATE + * @param[in] r_policy (Optional) Rounding policy used for the operation. Defaults to @ref RoundingPolicy::TO_ZERO + */ + EltwiseLayerDescriptor(EltwiseOperation op, QuantizationInfo out_quant_info = QuantizationInfo(), ConvertPolicy c_policy = ConvertPolicy::SATURATE, RoundingPolicy r_policy = RoundingPolicy::TO_ZERO) + : op(op), out_quant_info(out_quant_info), c_policy(c_policy), r_policy(r_policy) + { + } + + EltwiseOperation op; /**< Element-wise operation to perform */ + QuantizationInfo out_quant_info; /**< Output quantization information */ + ConvertPolicy c_policy; /**< Convert policy */ + RoundingPolicy r_policy; /**< Rounding policy */ +}; + } // namespace descriptor } // namespace graph } // namespace arm_compute -#endif /* ARM_COMPUTE_CONCAT_DESCRIPTOR_H */ \ No newline at end of file +#endif /* ARM_COMPUTE_LAYER_DESCRIPTORS_H */ \ No newline at end of file -- cgit v1.2.1