You cannot use the view function as you have written it - only one of the missing dimensions can be inferred (not more than one as you have written). This means that when adding a new axis to a tensor using view you have to specify all the other dimensions manually (except maybe 1). squeeze & unsqueeze pair of functions are utilities that make this very convenient, wherein we just specify where we want add or remove an axis.
Also, in the latest versions of PyTorch you can add a new axis by indexing with None as:
>>> input = torch.Tensor(2, 4, 3) # input: 2 x 4 x 3
>>> print(input[None].size())
torch.Size([1, 2, 4, 3])
>>> print(input[:, None].size())
torch.Size([2, 1, 4, 3])