diff options
author | Eric Kunze <eric.kunze@arm.com> | 2022-08-15 11:30:33 -0700 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2022-08-15 11:33:59 -0700 |
commit | 3c59d5d2b4c20ec64daff76fd04a374c5a5055e0 (patch) | |
tree | f1a3ff72b6887533a5602e5febc792ae003ec716 /reference_model | |
parent | c36636ef93a66e27e02e4d8d05a272808095216c (diff) | |
download | reference_model-3c59d5d2b4c20ec64daff76fd04a374c5a5055e0.tar.gz |
Check that the shape calculation for PAD is correct
Matches a corresponding change to the specification
Change-Id: If70356e0c78c1c88530e5d2f58bc50de864f249a
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Diffstat (limited to 'reference_model')
-rw-r--r-- | reference_model/src/ops/data_layout.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/reference_model/src/ops/data_layout.cc b/reference_model/src/ops/data_layout.cc index 9fe429b..7840450 100644 --- a/reference_model/src/ops/data_layout.cc +++ b/reference_model/src/ops/data_layout.cc @@ -169,6 +169,8 @@ int OpPad<Rank, Dtype>::checkTensorAttributes() int32_t pad_front = attribute->padding()[2 * i]; int32_t pad_back = attribute->padding()[2 * i + 1]; ERROR_IF((pad_front < 0) || (pad_back < 0), "OpPad: padding can't be smaller than 0"); + ERROR_IF(out->getShape()[i] != pad_front + in->getShape()[i] + pad_back, + "OpPad: output shape not equal to input plus padding"); paddings_array[i] = std::make_pair(pad_front, pad_back); } |