How can I stack tensors like this?

I’m trying to stack tensors with different size. But only dimension 2 is different while other dimensions are all same. Is there any way to do this? should work:

a = torch.randn(5, 5, 1)
b = torch.randn(5, 5, 4)
c =, b), dim=2)
> torch.Size([5, 5, 5])

thanks bro, you saved me :joy: :joy: