评价此页

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 设备上的张量时可能会产生非确定性梯度。有关更多信息,请参阅 可复现性