Solved by ptrblck in post #2 
              
              
                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)