aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichele Di Giorgio <michele.digiorgio@arm.com>2019-08-08 11:59:14 +0100
committerMichele Di Giorgio <michele.digiorgio@arm.com>2019-08-09 14:00:21 +0000
commit93c70b8d7c69ddcee58162c2618aa0e898b4bd1e (patch)
tree45912a9305600b37568fd9b1e5232666ab5448fe /src
parent172035864c8eb73fc46aeec1075423526a768e83 (diff)
downloadComputeLibrary-93c70b8d7c69ddcee58162c2618aa0e898b4bd1e.tar.gz
COMPMID-2547: CLSpaceToBatchLayer causes NN Test Failures on QUANT8_ASYMM Data Type
Change-Id: I47c9d057e50fa624f9b9e3fd79724e4fa7d0fd82 Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com> Reviewed-on: https://review.mlplatform.org/c/1713 Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/CL/kernels/CLSpaceToBatchLayerKernel.cpp5
-rw-r--r--src/core/NEON/kernels/NESpaceToBatchLayerKernel.cpp3
-rw-r--r--src/runtime/CL/functions/CLSpaceToBatchLayer.cpp10
-rw-r--r--src/runtime/NEON/functions/NESpaceToBatchLayer.cpp4
4 files changed, 12 insertions, 10 deletions
diff --git a/src/core/CL/kernels/CLSpaceToBatchLayerKernel.cpp b/src/core/CL/kernels/CLSpaceToBatchLayerKernel.cpp
index 1492f34f27..d2f676b00c 100644
--- a/src/core/CL/kernels/CLSpaceToBatchLayerKernel.cpp
+++ b/src/core/CL/kernels/CLSpaceToBatchLayerKernel.cpp
@@ -75,6 +75,7 @@ Status validate_arguments_static(const ITensorInfo *input, const int block_shape
ARM_COMPUTE_RETURN_ERROR_ON(input->tensor_shape()[idx_channel] != output->tensor_shape()[idx_channel]);
ARM_COMPUTE_RETURN_ERROR_ON(output->tensor_shape()[idx_batch] % (block_shape_x * block_shape_y) != 0);
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, output);
+ ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(input, output);
}
return Status{};
@@ -123,7 +124,7 @@ void CLSpaceToBatchLayerKernel::configure(const ICLTensor *input, const int bloc
ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
TensorShape output_shape = misc::shape_calculator::compute_space_to_batch_shape(input->info(), block_shape_x, block_shape_y, padding_left, padding_right);
- auto_init_if_empty(*output->info(), output_shape, 1, input->info()->data_type());
+ auto_init_if_empty(*output->info(), output_shape, 1, input->info()->data_type(), input->info()->quantization_info());
ARM_COMPUTE_ERROR_THROW_ON(validate_arguments_static(input->info(), block_shape_x, block_shape_y, padding_left, padding_right, output->info()));
@@ -205,4 +206,4 @@ void CLSpaceToBatchLayerKernel::run(const Window &window, cl::CommandQueue &queu
}
while(window.slide_window_slice_3D(slice_out));
}
-} // namespace arm_compute \ No newline at end of file
+} // namespace arm_compute
diff --git a/src/core/NEON/kernels/NESpaceToBatchLayerKernel.cpp b/src/core/NEON/kernels/NESpaceToBatchLayerKernel.cpp
index 511a109777..f51c3940b7 100644
--- a/src/core/NEON/kernels/NESpaceToBatchLayerKernel.cpp
+++ b/src/core/NEON/kernels/NESpaceToBatchLayerKernel.cpp
@@ -79,6 +79,7 @@ Status validate_arguments_static(const ITensorInfo *input, const int block_shape
ARM_COMPUTE_RETURN_ERROR_ON(input->tensor_shape()[idx_channel] != output->tensor_shape()[idx_channel]);
ARM_COMPUTE_RETURN_ERROR_ON(output->tensor_shape()[idx_batch] % (block_shape_x * block_shape_y) != 0);
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, output);
+ ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(input, output);
}
return Status{};
@@ -111,7 +112,7 @@ void NESpaceToBatchLayerKernel::configure(const ITensor *input, const int block_
ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
TensorShape output_shape = misc::shape_calculator::compute_space_to_batch_shape(input->info(), block_shape_x, block_shape_y, padding_left, padding_right);
- auto_init_if_empty(*output->info(), output_shape, 1, input->info()->data_type());
+ auto_init_if_empty(*output->info(), output_shape, 1, input->info()->data_type(), input->info()->quantization_info());
ARM_COMPUTE_ERROR_THROW_ON(validate_arguments_static(input->info(), block_shape_x, block_shape_y, padding_left, padding_right, output->info()));
diff --git a/src/runtime/CL/functions/CLSpaceToBatchLayer.cpp b/src/runtime/CL/functions/CLSpaceToBatchLayer.cpp
index a24b72e461..fa6e82efb0 100644
--- a/src/runtime/CL/functions/CLSpaceToBatchLayer.cpp
+++ b/src/runtime/CL/functions/CLSpaceToBatchLayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -44,7 +44,7 @@ void CLSpaceToBatchLayer::configure(const ICLTensor *input, const ICLTensor *blo
if(input->info()->tensor_shape().total_size() != output->info()->tensor_shape().total_size())
{
_has_padding = true;
- _memset_kernel.configure(output, PixelValue());
+ _memset_kernel.configure(output, PixelValue(0, input->info()->data_type(), input->info()->quantization_info()));
}
_space_to_batch_kernel.configure(input, block_shape, paddings, output);
}
@@ -56,14 +56,14 @@ void CLSpaceToBatchLayer::configure(const ICLTensor *input, const int block_shap
if(input->info()->tensor_shape().total_size() != output->info()->tensor_shape().total_size())
{
_has_padding = true;
- _memset_kernel.configure(output, PixelValue());
+ _memset_kernel.configure(output, PixelValue(0, input->info()->data_type(), input->info()->quantization_info()));
}
_space_to_batch_kernel.configure(input, block_shape_x, block_shape_y, padding_left, padding_right, output);
}
Status CLSpaceToBatchLayer::validate(const ITensorInfo *input, const ITensorInfo *block_shape, const ITensorInfo *paddings, const ITensorInfo *output)
{
- ARM_COMPUTE_RETURN_ON_ERROR(CLMemsetKernel::validate(output, PixelValue()));
+ ARM_COMPUTE_RETURN_ON_ERROR(CLMemsetKernel::validate(output, PixelValue(0, input->data_type(), input->quantization_info())));
ARM_COMPUTE_RETURN_ON_ERROR(CLSpaceToBatchLayerKernel::validate(input, block_shape, paddings, output));
return Status{};
@@ -72,7 +72,7 @@ Status CLSpaceToBatchLayer::validate(const ITensorInfo *input, const ITensorInfo
Status CLSpaceToBatchLayer::validate(const ITensorInfo *input, const int block_shape_x, const int block_shape_y, const Size2D &padding_left, const Size2D &padding_right,
const ITensorInfo *output)
{
- ARM_COMPUTE_RETURN_ON_ERROR(CLMemsetKernel::validate(output, PixelValue()));
+ ARM_COMPUTE_RETURN_ON_ERROR(CLMemsetKernel::validate(output, PixelValue(0, input->data_type(), input->quantization_info())));
ARM_COMPUTE_RETURN_ON_ERROR(CLSpaceToBatchLayerKernel::validate(input, block_shape_x, block_shape_y, padding_left, padding_right, output));
return Status{};
diff --git a/src/runtime/NEON/functions/NESpaceToBatchLayer.cpp b/src/runtime/NEON/functions/NESpaceToBatchLayer.cpp
index 46c28adfc0..205bc910a5 100644
--- a/src/runtime/NEON/functions/NESpaceToBatchLayer.cpp
+++ b/src/runtime/NEON/functions/NESpaceToBatchLayer.cpp
@@ -44,7 +44,7 @@ void NESpaceToBatchLayer::configure(const ITensor *input, const ITensor *block_s
if(input->info()->tensor_shape().total_size() != output->info()->tensor_shape().total_size())
{
_has_padding = true;
- _memset_kernel.configure(output, PixelValue());
+ _memset_kernel.configure(output, PixelValue(0, input->info()->data_type(), input->info()->quantization_info()));
}
_space_to_batch_kernel.configure(input, block_shape, paddings, output);
}
@@ -56,7 +56,7 @@ void NESpaceToBatchLayer::configure(const ITensor *input, const int block_shape_
if(input->info()->tensor_shape().total_size() != output->info()->tensor_shape().total_size())
{
_has_padding = true;
- _memset_kernel.configure(output, PixelValue());
+ _memset_kernel.configure(output, PixelValue(0, input->info()->data_type(), input->info()->quantization_info()));
}
_space_to_batch_kernel.configure(input, block_shape_x, block_shape_y, padding_left, padding_right, output);
}