I only have one tensor q=[150, 96, 96, 240], I have to somehow transform it into q=[150, 96, 96]. In your example, there is an additional w of size [150, 96, 96], which I don’t have. A summation could work I guess, but when I try it on q, it doesn’t do anything in my case: q.sum(3), doesn’t take away the last column.