Expand tensor dimension with ones

Hi, is there any simple way to expand tensor dimension to get something similar

input tensor

tensor([[25, 11],
        [25, 12],
        [25, 13],
        [25, 14]])

output tensor

tensor([[25, 11,  1],
        [25, 12,  1],
        [25, 13,  1],
        [25, 14,  1]])

Hi, you can try like this-

x = torch.randn((10,2))
y = torch.ones((x.shape[0],1))

final = torch.cat((x,y),1)

Thanks, It’s what i needed