Is it possible to have different dimension shapes for index and destination tensor in scatter_add_?

The problem i am considering is as follows:
I have a index tensor which essentially is an element connectivity matrix from fem with shape [N_e, 4]
and a src tensor which is a tensor describing the nodal components of each element with shape [N_e, 4]
what i want is to get a out tensor which is essentially the sum of all nodal components for each node with shape [N_n]. I thought this should be possible with scatter_add but this is producing a RuntimeError: Index tensor must have the same number of dimensions as self tensor.

for example we have

import torch 
elements= torch.tensor([[0,1,2,3],[1,4,5,2]]) #N_e=2
src= torch.tensor([[8, 6, 4, 9],
                   [5, 3, 0, 7]])
#then i want out tensor to look like 
out= torch.tensor([8, 6+5, 4+7, 9, 3, 0])

#my approach
out = torch.zeros(6) #N_n=6
out.scatter_add_(0, elements, src)

can you please tell me if i am in the right direction or i should simply add all the individual components seperately?

I solved the problem using index_add