I found out that first unsqueezing the G tensor, repeating it 4 times along the 3-th dimension, and element-wise multiplying it with E does the job, but there may be a more elegant solution. Here is the code:
G_tmp = G.unsqueeze(2).expand(-1, -1, 4)
res = G_tmp * E
Feel free to correct me, or propose a more elegant solution