eg. a = torch.rand(3) # [torch.FloatTensor of size 3]
which operation can I convert this tensor to size 1*3 ???
eg. a = torch.rand(3) # [torch.FloatTensor of size 3]
which operation can I convert this tensor to size 1*3 ???
You can either use .view(1, 3)
, or .unsqueeze(0)
.
I tried it but doesn’t work…
ah…it works…sorry, I made some mistakes just now…thank you for your help!!!