Sorry my bad!
I’ve read your problem and thought I still had it in mind when I created the example.
Apparently I’ve mixed up the shapes. 
Would this work then:
q = torch.randn(15, 9, 9, 2)
w = torch.randn(1, 1, 1, 2)
(q*w).sum(3)