converting 1 x 1 x 33 tensor to 1 x 1 x 34 while maintaining values and leaving the 34th index 0
I have a tensor of 0 and and one 1 in a 1 by 1 by 33 tensor and I want all the indexes that are 1 to stay one, but be in a 1 by 1 by 34 tensor. What's the standard practice for this? Apparently using "reshape is bad" for this.

You can use pad to pad either the beginning or end of a tensor with zeros.

For example

import torch.nn.functional as F
x = F.pad(x, (0, 1))


will pad the end of the last dimension of a 3d tensor x with 1 zero.
