快捷方式

torch.nn.functional.upsample_nearest

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

使用最近鄰畫素值對輸入進行上取樣。

警告

此函式已棄用,推薦使用 torch.nn.functional.interpolate()。這等同於 nn.functional.interpolate(..., mode='nearest')

目前支援空間和體積上取樣(即預期輸入是 4 或 5 維)。

引數
  • input (Tensor) – 輸入

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

  • scale_factor (int) – 空間大小的乘數。必須是整數。

注意

在 CUDA 裝置上給定 tensor 時,此操作可能會產生非確定性梯度。更多資訊請參見 可復現性

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取針對初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並解答問題

檢視資源