Rate this Page

torch.nn.functional.upsample_nearest#

torch.nn.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 oftorch.nn.functional.interpolate().This is equivalent withnn.functional.interpolate(...,mode='nearest').

Currently spatial and volumetric upsampling are supported (i.e. expectedinputs are 4 or 5 dimensional).

Parameters
  • input (Tensor) – input

  • size (int orTuple[int,int] orTuple[int,int,int]) – output spatiasize.

  • scale_factor (int) – multiplier for spatial size. Has to be an integer.

Note

This operation may produce nondeterministic gradients when given tensors on a CUDA device. SeeReproducibility for more information.