Hi,
This works OK:
x=Variable(torch.range(1,24))
x.resize(3,8)
But this gives an error:
x=Variable(torch.range(1,24))
m=Variable(torch.FloatTensor([3]))
n=Variable(torch.FloatTensor([8]))
x.resize(m,n)
Is this a bug?
The error message I get is:
RuntimeError: requested resize to Variable containing:
3
[torch.FloatTensor of size 1]
xVariable containing:
8
[torch.FloatTensor of size 1]
(Variable containing:
24
[torch.FloatTensor of size 1]
elements in total), but the given tensor has a size of 24 (24 elements). autograd’s resize can only change the shape of a given tensor, while preserving the number of elements.