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 维)。
- 参数
注意
此操作在使用 CUDA 设备上的张量时可能会产生非确定性梯度。有关更多信息,请参阅 可复现性。