評價此頁

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 裝置上的張量時可能會產生非確定性梯度。有關更多資訊,請參閱 可復現性