捷徑

torch.nn.functional.upsample_nearest

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

使用最近鄰的像素值對輸入進行升採樣。

警告

此函數已被棄用,建議使用 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 設備上給定 tensors 時,此操作可能會產生非確定性的梯度。 有關更多訊息,請參閱再現性

文件

取得 PyTorch 的完整開發者文件

檢視文件

教學

取得適合初學者和進階開發者的深入教學

檢視教學

資源

尋找開發資源並獲得您的問題解答

檢視資源