Hi Pi!



 p_may:

About wpe, atten_matrix[B][:][i] * ee.permute(0,2,1) gives me L vectors (L x dim) and I sum them up along the second (actually third) dimension (dim=2), which gives me one vector (1 x dim).


Please post complete, working code – with loops – that does
what you want (and the results you get when you run it).  That
will be the most satisfactory description of what you are trying
to do.
Best.
K. Frank