评价此页

torch.nn.functional.upsample_nearest#

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

使用最近邻像素值对输入进行上采样。

警告

该函数已弃用,推荐使用 torch.nn.functional.interpolate()。这等同于 nn.functional.interpolate(..., mode='nearest')

目前支持空间和体积上采样(即期望的输入是4维或5维)。

参数
  • input (张量) – 输入

  • size (intTuple[int, int] 或 Tuple[int, int, int]) – 输出空间大小。

  • scale_factor (int) – 空间大小的乘数。必须是整数。

注意

此操作在使用 CUDA 设备上的张量时可能会产生非确定性梯度。有关更多信息,请参阅 可复现性