aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/UNIT/SubTensorInfo.cpp
diff options
context:
space:
mode:
authorRamy Elgammal <ramy.elgammal@arm.com>2022-12-22 15:21:03 +0000
committerRamy Elgammal <ramy.elgammal@arm.com>2023-01-09 15:41:02 +0000
commitd2d9361a0a338bce478f7d85b4af70d1ed20f26c (patch)
treed7f8491bb1175a0a0fb28bc916e2078e2947e4e2 /tests/validation/UNIT/SubTensorInfo.cpp
parentf800adf185e966b16385f65b9c7250766949dbe4 (diff)
downloadComputeLibrary-d2d9361a0a338bce478f7d85b4af70d1ed20f26c.tar.gz
Add extend padding lock flag
- ITensorInfo's padding cannot be extended if its lock_paddings flag is set to True. Resolves: COMPMID-5714 Signed-off-by: Ramy Elgammal <ramy.elgammal@arm.com> Change-Id: I6bca9bbf7172822af60562310578c438b9e15f46 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8875 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: SiCong Li <sicong.li@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/UNIT/SubTensorInfo.cpp')
-rw-r--r--tests/validation/UNIT/SubTensorInfo.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/validation/UNIT/SubTensorInfo.cpp b/tests/validation/UNIT/SubTensorInfo.cpp
index 5a930620ce..ca5e46550c 100644
--- a/tests/validation/UNIT/SubTensorInfo.cpp
+++ b/tests/validation/UNIT/SubTensorInfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020 Arm Limited.
+ * Copyright (c) 2020-2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -69,6 +69,7 @@ TEST_CASE(SubTensorCreation, framework::DatasetMode::ALL)
* - A) Extend padding when SubTensor XY does not match parent tensor should fail
* B) Extend with zero padding when SubTensor XY does not match parent tensor should succeed
* - C) Extend padding when SubTensor XY matches parent tensor should succeed
+ * - D) Set lock padding to true, so that extend padding would fail
*/
TEST_CASE(SubTensorPaddingExpansion, framework::DatasetMode::ALL)
{
@@ -95,6 +96,14 @@ TEST_CASE(SubTensorPaddingExpansion, framework::DatasetMode::ALL)
ARM_COMPUTE_EXPECT(tensor_info.padding().top == 2, framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(tensor_info.padding().right == 1, framework::LogLevel::ERRORS);
}
+
+ // Test D
+ {
+ TensorInfo tensor_info(TensorShape(23U, 17U, 3U), 1, DataType::F32);
+ SubTensorInfo sub_tensor_info(&tensor_info, TensorShape(4U, 3U, 1U), Coordinates(5, 2, 1));
+ sub_tensor_info.set_lock_paddings(true);
+ ARM_COMPUTE_EXPECT_THROW(sub_tensor_info.extend_padding(PaddingSize(2, 1)), framework::LogLevel::ERRORS);
+ }
}
TEST_SUITE_END() // SubTensorInfo