aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2019-02-12 11:09:48 +0000
committerIsabella Gottardi <isabella.gottardi@arm.com>2019-02-12 17:06:30 +0000
commit54d2376c6f994b06111522527c0f86f4e6b2aa71 (patch)
treebbe5765a728a60091349af0e61b205969582ee77
parent75d4122405e29505c1d97f55f4ae6da775140ed9 (diff)
downloadComputeLibrary-54d2376c6f994b06111522527c0f86f4e6b2aa71.tar.gz
COMPMID-1981: fixed Nightly DepthConcatenate QASMM8 mismatches
Change-Id: Ibd72e03ffa6aa50543b3c410d6167231fdd16990 Signed-off-by: Pablo Tello <pablo.tello@arm.com> Reviewed-on: https://review.mlplatform.org/662 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: VidhyaSudhan Loganathan <vidhyasudhan.loganathan@arm.com>
-rw-r--r--tests/validation/reference/DepthConcatenateLayer.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/tests/validation/reference/DepthConcatenateLayer.cpp b/tests/validation/reference/DepthConcatenateLayer.cpp
index 7775614171..f0dab3baac 100644
--- a/tests/validation/reference/DepthConcatenateLayer.cpp
+++ b/tests/validation/reference/DepthConcatenateLayer.cpp
@@ -51,20 +51,23 @@ SimpleTensor<T> depthconcatenate_layer(const std::vector<SimpleTensor<T>> &srcs,
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())
{
- // input tensors can have smaller width and height than the output, so for each output's slice we need to requantize 0 (as this is the value
- // used in NEFillBorderKernel by NEDepthConcatenateLayer) using the corresponding quantization info for that particular slice/input tensor.
- int slice = 0;
- for(const auto &src : srcs)
+ for(int b = 0; b < batches; ++b)
{
- auto ptr_slice = static_cast<T *>(dst(Coordinates(0, 0, slice)));
- std::transform(ptr_slice, ptr_slice + dst.num_elements() / depth_out, ptr_slice, [src, dst](T t)
+ // input tensors can have smaller width and height than the output, so for each output's slice we need to requantize 0 (as this is the value
+ // used in NEFillBorderKernel by NEDepthConcatenateLayer) using the corresponding quantization info for that particular slice/input tensor.
+ int slice = 0;
+ for(const auto &src : srcs)
{
- return dst.quantization_info().quantize(src.quantization_info().dequantize(0), RoundingPolicy::TO_NEAREST_UP);
- });
- slice += src.shape().z();
+ auto ptr_slice = static_cast<T *>(dst(Coordinates(0, 0, slice, b)));
+ const auto num_elems_in_slice((dst.num_elements() / depth_out) * src.shape().z());
+ std::transform(ptr_slice, ptr_slice + num_elems_in_slice, ptr_slice, [src, dst](T t)
+ {
+ return dst.quantization_info().quantize(src.quantization_info().dequantize(0), RoundingPolicy::TO_NEAREST_UP);
+ });
+ slice += src.shape().z();
+ }
}
}
else