Thank you for your reply.
I totally agree with the first part of your explanation.
Let me explain a little more about why i want to compute it like that.
Here is what i am trying to do:
lets say i have features channel 'x = torch.ones(1,2, 10, 10)and 'y = torch.ones(1,2, 10, 10).
What im trying to do is to weight each feature channel in y based on the similarity of that channel with its corresponding channel in x.
of course i can use the cosine similarity for the whole x and y and just multiply each channel of y with that similarity via mul, but i feel like i should compute the similarity between the feature channels separately. meaning that channel 1 should be weighted with similarity between x[0,0,:,:] and y[0,0,:,:] and channel 2 should be weighted with similarity between x[0,1,:,:] and y[0,1,:,:]
please let me know if it is not clear