how to add tensor size pytorch
I have a problem while working on PyTorch.

I'm trying to increase tensor size from [1,97,1] to [1,97,2]. How can I add "1" in tensor size?

Use pad

import torch.nn.functional as F
a = torch.empty((1,97,1))

a = F.pad(input=a, pad=(0,1))     # pad = (padding_left,padding_right)

print(a.shape)
&gt;&gt;&gt; torch.Size([1, 97, 2])


it will pad 0 constant by default at right sight. 
