From 96a14008af85725d067cdd8247023474581102ea Mon Sep 17 00:00:00 2001 From: thecha01 Date: Tue, 28 Jul 2020 17:45:07 +0100 Subject: Fix EltwiseLayerNode and QuantizationLayerNode - Fixed issue where EltwiseLayerNode would base output shape off of first input tensor only - Allow QuantizationLayerNode to use any quantized data type if specified in constructor Signed-off-by: thecha01 Change-Id: Ib93470316799028cd573592a3d79943493eaa093 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3737 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Reviewed-by: Manuel Bottini --- src/graph/nodes/QuantizationLayerNode.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/graph/nodes/QuantizationLayerNode.cpp') diff --git a/src/graph/nodes/QuantizationLayerNode.cpp b/src/graph/nodes/QuantizationLayerNode.cpp index db70c2c312..08e2a4d961 100644 --- a/src/graph/nodes/QuantizationLayerNode.cpp +++ b/src/graph/nodes/QuantizationLayerNode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Arm Limited. + * Copyright (c) 2019-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -31,8 +31,15 @@ namespace arm_compute namespace graph { QuantizationLayerNode::QuantizationLayerNode(QuantizationInfo out_quant_info) - : _out_quant_info(std::move(out_quant_info)) + : QuantizationLayerNode(out_quant_info, DataType::QASYMM8) { +} + +QuantizationLayerNode::QuantizationLayerNode(QuantizationInfo out_quant_info, DataType out_data_type) + : _out_quant_info(std::move(out_quant_info)), _out_data_type(out_data_type) +{ + ARM_COMPUTE_ERROR_ON(!is_data_type_quantized(out_data_type)); + _input_edges.resize(1, EmptyEdgeID); _outputs.resize(1, NullTensorID); } @@ -58,7 +65,7 @@ TensorDescriptor QuantizationLayerNode::configure_output(size_t idx) const ARM_COMPUTE_ERROR_ON(src == nullptr); TensorDescriptor output_info = src->desc(); - output_info.data_type = DataType::QASYMM8; + output_info.data_type = _out_data_type; output_info.quant_info = _out_quant_info; return output_info; -- cgit v1.2.1