How to scale a tensor (not pil image)?

for a given tensor which is 10x10, i need to scale it to 15x15.
so how to scale a tensor (not pil image) ? can be a tensor directly scaled?

Have a look at nn.Upsample.
Here is a small code example:

a = torch.randn(1, 3, 10, 10)
upsample = nn.Upsample(size=15, mode='bilinear')
b = upsample(a)

is the method newest?
why my pytorch has no Upsampleā€¦
image

Which PyTorch version are you using?
This method with these arguments is available in the latest stable release (0.4.0).
I accidentally copied a link to the master doc. Here is the right one pointing to the latest release: link.

If your PyTorch version is < 0.4.0, I would suggest to update it.
You can find the install instructions on the website.

maybe my version is older. thanks, if there is no solution, i will update it.