Depending how you would like to increase this dimension, you could use


F.pad and pad the dimension to the desired shape
create another tensor in the “missing” shape and use torch.cat((x, other), dim=1) to concatenate them
concatenate the tensor to itself and pad the rest

Let me know, if that would work or if you would like to apply another approach.