| 199 | } |
| 200 | |
| 201 | bool AccessWindowTranspose::update_padding_if_needed(const Window &window) |
| 202 | { |
| 203 | // Only update the padding if the tensor allows it |
| 204 | if (_info == nullptr || !_info->is_resizable()) |
| 205 | { |
| 206 | return false; |
| 207 | } |
| 208 | |
| 209 | ARM_COMPUTE_ERROR_ON(window.y().step() == 0); |
| 210 | ARM_COMPUTE_ERROR_ON(window.x().step() == 0); |
| 211 | |
| 212 | const int min_x = window.y().start() * _scale_x + _x; |
| 213 | const int max_x = (window.y().end() - window.y().step()) * _scale_x + _x + _width; |
| 214 | const int min_y = window.x().start() * _scale_y + _y; |
| 215 | const int max_y = (window.x().end() - window.x().step()) * _scale_y + _y + _height; |
| 216 | |
| 217 | const TensorShape &shape = _info->tensor_shape(); |
| 218 | |
| 219 | PaddingSize padding; |
| 220 | padding.left = std::max(0, -min_x); |
| 221 | padding.right = std::max<int>(0, max_x - shape[0]); |
| 222 | padding.top = std::max(0, -min_y); |
| 223 | padding.bottom = std::max<int>(0, max_y - shape[1]); |
| 224 | |
| 225 | // Update strides in tensor info |
| 226 | return _info->extend_padding(padding); |
| 227 | } |
nothing calls this directly
no test coverage detected