Solved by InnovArul in post #2 
              
              
                This might work for you. 
import torch
a = torch.randn(5,2,4)
b = torch.randn(5,4)
c = torch.cat([x, y.unsqueeze(1).repeat(1, x.shape[1], 1)], dim=2)