Solved by ptrblck in post #11 
              
              
                Thanks for the explanation. 
In this case, would you want to use the 10x10 pixels as the vector to calculate the cosine similarity? 
Each channel would therefore hold a 100-dimensional vector pointing somewhere and you could calculate the similarity between the channels. 
a = torch.randn(1, 2, 10, 1…