Angelina_Robert:

however, in my case feature size is 128,2,128 instead of 4.


What do these dimensions mean? E.g. is one of them the batch dimensions and others feature dimensions? What would a size of 4 for dim1 mean and why are you currently calling features.view(bsz, 2, -1)?
As already said, I’m not familiar with this paper, but can assist in debugging some code, if you can explain what you are trying to each achieve and what is currently not working.