Ger*_*_Ji 3 computer-vision pytorch tensor
Now I have a torch.Tensor
of size (5, 1, 44, 44)
in Pytorch.
and I want to 'resize' it to shape (5, 1, 224, 224)
How can I do that? What functions should I use?
It seems like you are looking for interpolate
(a function in nn.functional
):
import torch.nn.functional as nnf
x = torch.rand(5, 1, 44, 44)
out = nnf.interpolate(x, size=(224, 224), mode='bicubic', align_corners=False)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
54 次 |
最近记录: |