diff options
author | Jeremy Johnson <jeremy.johnson@arm.com> | 2021-10-19 15:56:42 +0100 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2021-10-21 18:32:52 +0000 |
commit | 58026d6839617f648ef8f7c6e106cf5acf2a4cc2 (patch) | |
tree | 400b1903da5840729acb16ce35655c9e9895ab78 /reference_model/src/ops/tensor_ops.cc | |
parent | 5d00c69051bef9f27b60ba136c0efc49a45bf8e6 (diff) | |
download | reference_model-58026d6839617f648ef8f7c6e106cf5acf2a4cc2.tar.gz |
Fix pool2d generation and check to match specification
Change output size error_if check in ref model to match specification.
Remove size check from test generation as output shape is always
correctly calculated.
Change-Id: I5be64f31e6448b47e80fc0a4af11bb312f366a26
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Diffstat (limited to 'reference_model/src/ops/tensor_ops.cc')
-rw-r--r-- | reference_model/src/ops/tensor_ops.cc | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/reference_model/src/ops/tensor_ops.cc b/reference_model/src/ops/tensor_ops.cc index be4e4aa..059638a 100644 --- a/reference_model/src/ops/tensor_ops.cc +++ b/reference_model/src/ops/tensor_ops.cc @@ -92,13 +92,8 @@ int check_pool2d_attribute_common(tosa::TosaPoolAttribute* attribute, return 1; } - int32_t allowed_min_input_height = (OH * stride_y) - pad_top - pad_bottom - stride_y + kernel_y; - int32_t allowed_min_input_width = (OW * stride_x) - pad_left - pad_right - stride_x + kernel_x; - - int32_t d_height = IH - allowed_min_input_height; - int32_t d_width = IW - allowed_min_input_width; - - if (d_height < 0 || d_height > stride_y || d_width < 0 || d_width > stride_x) + if ( OH != (IH + pad_top + pad_bottom + stride_y - kernel_y) / stride_y || + OW != (IW + pad_left + pad_right + stride_x - kernel_x) / stride_x ) { msg = "Mismatch between output shape provided and expected output shape"; return 1; |