From ec96d6c5e80d8db15b5760c6770f02b9f2974b6a Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 20 Feb 2019 11:16:57 +0000 Subject: COMPMID-1710: Fix DepthConcatenate reference with different quantization Change-Id: If154fcc383039bf7a7ad46d4110067c45b922707 Signed-off-by: Georgios Pinitas Reviewed-on: https://review.mlplatform.org/737 Reviewed-by: Pablo Marquez Tested-by: Arm Jenkins --- tests/validation/reference/DepthConcatenateLayer.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/validation/reference/DepthConcatenateLayer.cpp b/tests/validation/reference/DepthConcatenateLayer.cpp index f0dab3baac..139675d108 100644 --- a/tests/validation/reference/DepthConcatenateLayer.cpp +++ b/tests/validation/reference/DepthConcatenateLayer.cpp @@ -45,13 +45,17 @@ SimpleTensor depthconcatenate_layer(const std::vector> &srcs, } // Compute reference - int depth_offset = 0; - const int width_out = dst.shape().x(); - const int height_out = dst.shape().y(); - const int depth_out = dst.shape().z(); - const int out_stride_z = width_out * height_out; - const int batches = dst.shape().total_size_upper(3); - if(srcs[0].data_type() == DataType::QASYMM8 && srcs[0].quantization_info() != dst.quantization_info()) + int depth_offset = 0; + const int width_out = dst.shape().x(); + const int height_out = dst.shape().y(); + const int depth_out = dst.shape().z(); + const int out_stride_z = width_out * height_out; + const int batches = dst.shape().total_size_upper(3); + auto have_different_quantization_info = [&](const SimpleTensor &tensor) + { + return tensor.quantization_info() != dst.quantization_info(); + }; + if(srcs[0].data_type() == DataType::QASYMM8 && std::any_of(srcs.cbegin(), srcs.cend(), have_different_quantization_info)) { for(int b = 0; b < batches; ++b) { -- cgit v1.2.1