diff options
author | thecha01 <theo.charalambous@arm.com> | 2020-07-28 17:45:07 +0100 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2020-08-25 10:17:55 +0000 |
commit | 96a14008af85725d067cdd8247023474581102ea (patch) | |
tree | a920ff3766133ec0012964d2fbfbdfa39aed1d5a /src/graph/nodes/QuantizationLayerNode.cpp | |
parent | 90251bc1e162925c4b85e8a2923af153af23da93 (diff) | |
download | ComputeLibrary-96a14008af85725d067cdd8247023474581102ea.tar.gz |
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 <theo.charalambous@arm.com>
Change-Id: Ib93470316799028cd573592a3d79943493eaa093
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3737
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-by: Manuel Bottini <manuel.bottini@arm.com>
Diffstat (limited to 'src/graph/nodes/QuantizationLayerNode.cpp')
-rw-r--r-- | src/graph/nodes/QuantizationLayerNode.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
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; |