Inflating the tensor up to a certain size

Let’s say if I have a tensor of size (a,b,c_1), and now I wish to inflate it to (a,b,c_2) for some c_2 > c_1, is there a function to do this? Note that I am NOT changing the number of dimensions of the tensor; instead, I am just increasing one or more dimensions of the tensor. Thanks.

You could use tensor.expand, if you want to increase a singleton dimension with a view, tensor.repeat to repeat the values in this dimension, or torch.cat to concatenate different tensors and thus increasing the size in this dimension.