What is the effect of Torch.nn.Upsample VS F.resize

Hi,

Just curious to know if there is a difference in terms of the pixel value or any if I use torch.nn.upsample vs F.resize? assuming both functions resize/upsample to the same pixel size and the resampling method is Nearest.

Thank you!

They are the same inside.
When you look inside the source code of torch.nn.upsample, you will find that the forward function of upsample is relized by F.resize( I think you maybe point interpolate function)

def forward(self, input: Tensor) -> Tensor:
    return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners)