[GPU] Fix out of range check for pooling (#17612)

* [GPU] Fix out of range check for pooling

* [GPU] Fix out of range check for pooling
This commit is contained in:
Pavel Durandin 2023-05-19 14:01:27 +04:00 committed by GitHub
parent 4eebd3a976
commit 54bbc9e603
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,7 +131,7 @@ public:
// adjusted to that, to work properly this calculation must take pad_end into account.
auto dynamic_mode = false;
for (size_t i = 0; i < spatial_rank; i++) {
dynamic_mode |= (((output_layout.spatial(i) - 1) * stride[spatial_rank - i - 1]) + primitive->size[spatial_rank - i - 1]) >
dynamic_mode |= (((output_layout.spatial(i) - 1) * stride[spatial_rank - i - 1]) + kernel[spatial_rank - i - 1]) >
static_cast<size_t>(pads_end[spatial_rank - i - 1] + pads_begin[spatial_rank - i - 1] + input_layout.spatial(i));
}