<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/models/blob/v2.20.0/official/vision/ops/preprocess_ops.py#L148-L174) |

Compute the padded size given the desired size and the stride.

    tfm.vision.preprocess_ops.compute_padded_size(
        desired_size, stride
    )

The padded size will be the smallest rectangle, such that each dimension is
the smallest multiple of the stride which is larger than the desired
dimension. For example, if desired_size = (100, 200) and stride = 32,
the output padded_size = (128, 224).

<br />

<br />

<br />

| ## Args ||
|---|---|
| `desired_size` | a `Tensor` or `int` list/tuple of two elements representing \[height, width\] of the target output image size. |
| `stride` | an integer, the stride of the backbone network. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `padded_size` | a `Tensor` or `int` list/tuple of two elements representing \[height, width\] of the padded output image size. |

<br />