aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSang-Hoon Park <sang-hoon.park@arm.com>2020-06-22 13:48:56 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2020-06-22 19:07:10 +0000
commit9e4b899efb0eb78e86c5e2ea76a360776d85241d (patch)
treebe6af096252e8338ba7c383e7037851b5642f4e4 /tests
parent80feed5193de6b10d8ab65b42fb988c241c5d09d (diff)
downloadComputeLibrary-9e4b899efb0eb78e86c5e2ea76a360776d85241d.tar.gz
COMPMID-3364: prevent auto dimension correction for ScaleFixture
Auto dimension correction makes tests failed when data layout is NHWC and the last dimension has size of one which results in difference in number of dimensions from reference's result based on NCHW. Change-Id: I25c17870448ecc5a658774dbd01cddc7462cb09a Signed-off-by: Sang-Hoon Park <sang-hoon.park@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3432 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/validation/fixtures/ScaleFixture.h4
-rw-r--r--tests/validation/reference/Scale.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/validation/fixtures/ScaleFixture.h b/tests/validation/fixtures/ScaleFixture.h
index 199186f8e2..12d9012ece 100644
--- a/tests/validation/fixtures/ScaleFixture.h
+++ b/tests/validation/fixtures/ScaleFixture.h
@@ -133,8 +133,8 @@ protected:
const int idx_height = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT);
TensorShape shape_scaled(shape);
- shape_scaled.set(idx_width, shape[idx_width] * _scale_x);
- shape_scaled.set(idx_height, shape[idx_height] * _scale_y);
+ shape_scaled.set(idx_width, shape[idx_width] * _scale_x, /* apply_dim_correction = */ false);
+ shape_scaled.set(idx_height, shape[idx_height] * _scale_y, /* apply_dim_correction = */ false);
TensorType dst = create_tensor<TensorType>(shape_scaled, _data_type, 1, _quantization_info, data_layout);
// Create and configure function
diff --git a/tests/validation/reference/Scale.cpp b/tests/validation/reference/Scale.cpp
index 06bc42004f..cb4ad6f909 100644
--- a/tests/validation/reference/Scale.cpp
+++ b/tests/validation/reference/Scale.cpp
@@ -42,8 +42,8 @@ SimpleTensor<T> scale_core(const SimpleTensor<T> &in, float scale_x, float scale
// Add 1 if ceil_policy_scale is true
const size_t round_value = ceil_policy_scale ? 1U : 0U;
TensorShape shape_scaled(in.shape());
- shape_scaled.set(0, (in.shape()[0] + round_value) * scale_x);
- shape_scaled.set(1, (in.shape()[1] + round_value) * scale_y);
+ shape_scaled.set(0, (in.shape()[0] + round_value) * scale_x, /* apply_dim_correction = */ false);
+ shape_scaled.set(1, (in.shape()[1] + round_value) * scale_y, /* apply_dim_correction = */ false);
SimpleTensor<T> out(shape_scaled, in.data_type());
// Compute the ratio between source width/height and destination width/height