How to extend Tensors inside Variable?

Hello, I’m starting with torch and I don’t know how to add another number to Tensor.

For examle, I have FloatTensor x and I would like to add Tensor z at the end of it and get something like tensor y.

Is that possible? Thanks a lot and sorry for my English

You could try torch.cat:

x = torch.ones(2, 3, 8)
z = (torch.ones(6) * 5).view(2, 3, 1)
# or this
z = torch.ones(2, 3, 1) * 5
y = torch.cat((x, z), dim=2)