pytorch / 2 / generated / torch.ao.nn.quantized.functional.upsample_nearest.html

upsample_nearest

class torch.ao.nn.quantized.functional.upsample_nearest(input, size=None, scale_factor=None) [source]

Upsamples the input, using nearest neighbours’ pixel values.

Warning

This function is deprecated in favor of torch.ao.nn.quantized.functional.interpolate(). This is equivalent with nn.quantized.functional.interpolate(..., mode='nearest').

Note

The input quantization parameters propagate to the output.

Note

Only 2D inputs are supported

Parameters
  • input (Tensor) – quantized input
  • size (int or Tuple[int, int] or Tuple[int, int, int]) – output spatial size.
  • scale_factor (int) – multiplier for spatial size. Has to be an integer.

© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.ao.nn.quantized.functional.upsample_nearest.html