Reputation: 97
I have a tensor that looks like this:
I would like to add 0 to each inner tensor. So we have something like[0.1111, 0.6667, 0]. Any suggestion would be appreciated.
Upvotes: 5
Views: 15321
Reputation: 86
You can do :
z = torch.zeros((10,1)) torch.cat((your_tensor,z),1)
Upvotes: 4