aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2019-02-11 17:03:15 +0000
committerIsabella Gottardi <isabella.gottardi@arm.com>2019-02-12 16:59:54 +0000
commit5323de6348f81c7fee83b2e44841f37f720cad1e (patch)
treea069d19b91114ae1f509671b7687173bb3a0b258
parent130edad0edb3d29f37933696004d86405df5bb35 (diff)
downloadComputeLibrary-5323de6348f81c7fee83b2e44841f37f720cad1e.tar.gz
COMPMID-1918: Fixed mismatches in NEDepthConcatenateLayer
Change-Id: I8d1d65297f30d11cf2e62539d7a823ed8e409cf0 Signed-off-by: Pablo Tello <pablo.tello@arm.com> Reviewed-on: https://review.mlplatform.org/660 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
-rw-r--r--tests/validation/reference/DepthConcatenateLayer.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/validation/reference/DepthConcatenateLayer.cpp b/tests/validation/reference/DepthConcatenateLayer.cpp
index 6551f0c79e..7775614171 100644
--- a/tests/validation/reference/DepthConcatenateLayer.cpp
+++ b/tests/validation/reference/DepthConcatenateLayer.cpp
@@ -52,8 +52,25 @@ SimpleTensor<T> depthconcatenate_layer(const std::vector<SimpleTensor<T>> &srcs,
const int out_stride_z = width_out * height_out;
const int batches = dst.shape().total_size_upper(3);
- // Set output tensor to 0
- std::fill_n(dst.data(), dst.num_elements(), 0);
+ 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)
+ {
+ 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)
+ {
+ return dst.quantization_info().quantize(src.quantization_info().dequantize(0), RoundingPolicy::TO_NEAREST_UP);
+ });
+ slice += src.shape().z();
+ }
+ }
+ else
+ {
+ std::fill_n(dst.data(), dst.num_elements(), 0);
+ }
for(const auto &src : srcs)
{