Hey @Yunchao_Liu
I think here you would need to keep the dims of both the matrices the same. With reference to the docs 2 we need to have same shape matrices and do the cosine similarity on a said dim.
With that in mind, we will have a value from the range of -1 to 1.