i have three tensors. First one, lets say ‘a’ has a dimension of (15, 128)
. Second one, ‘b’ has dimension (2, 128)
and third one ‘c’ has dimension (417, 128)
.
Now i want to add them like,
d = a+b+c
I do not want to concatenate or stack them. I just want to add them because i want
d should have dimension of (417,128)
. How can i do this in pytorch?
This is the error i get:
a = torch.randn(2,128)
b = torch.randn(15,128)
c = torch.randn(417,128)
d = a+b+c
RuntimeError: The size of tensor a (2) must match the size of tensor b (15) at non-singleton dimension.