<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/spatial_transform_ops.py#L528-L556) |

Nearest neighbor upsampling implementation.

    tfm.vision.spatial_transform_ops.nearest_upsampling(
        data: tf.Tensor, scale: int, use_keras_layer: bool = False
    ) -> tf.Tensor

<br />

<br />

<br />

| ## Args ||
|---|---|
| `data` | A tensor with a shape of \[batch, height_in, width_in, channels\]. |
| `scale` | An integer multiple to scale resolution of input data. |
| `use_keras_layer` | If True, use keras Upsampling2D layer. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `data_up` | A tensor with a shape of \[batch, height_in*scale, width_in*scale, channels\]. Same dtype as input data. |

<br />