diff options
author | Sang-Hoon Park <sang-hoon.park@arm.com> | 2019-11-12 16:26:26 +0000 |
---|---|---|
committer | Pablo Marquez <pablo.tello@arm.com> | 2019-11-18 13:47:50 +0000 |
commit | 46023ed57210a0f72e6df457af8a8cd966d6565b (patch) | |
tree | aa2139b620715949f0265cac551bb0c7d0448d36 /src/core | |
parent | f49b8ebf530630ec1f311b8ff0c772814825becc (diff) | |
download | ComputeLibrary-46023ed57210a0f72e6df457af8a8cd966d6565b.tar.gz |
COMPMID-2919 add error message for zero stride values
The error message is added to function computing padding
requirements.
Change-Id: I2869577e587dbb8153b5abca4d63f3ba999e7e2f
Signed-off-by: Sang-Hoon Park <sang-hoon.park@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2305
Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Utils.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/Utils.cpp b/src/core/Utils.cpp index 9f1255dcaf..cbf6e48375 100644 --- a/src/core/Utils.cpp +++ b/src/core/Utils.cpp @@ -340,13 +340,15 @@ std::string arm_compute::lower_string(const std::string &val) PadStrideInfo arm_compute::calculate_same_pad(TensorShape input_shape, TensorShape weights_shape, PadStrideInfo conv_info, DataLayout data_layout, const Size2D &dilation, const DimensionRoundingType &rounding_type) { + const auto &strides = conv_info.stride(); + ARM_COMPUTE_ERROR_ON_MSG((strides.first < 1 || strides.second < 1), "Stride values should be greater than or equal to 1."); + const unsigned int width_idx = arm_compute::get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); const unsigned int height_idx = arm_compute::get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); const unsigned int in_width = input_shape[width_idx]; const unsigned int in_height = input_shape[height_idx]; const unsigned int kernel_width = weights_shape[width_idx]; const unsigned int kernel_height = weights_shape[height_idx]; - const auto &strides = conv_info.stride(); // Calculate output dimensions const auto is_ceil = static_cast<unsigned int>(rounding_type == DimensionRoundingType::CEIL); |