SimCSE-Pytorch
SimCSE-Pytorch copied to clipboard
F.cosine_similarity
---> 12 sim = F.cosine_similarity(y_pred.unsqueeze(1), y_pred.unsqueeze(0), dim=-1) 13 14 # 将相似度矩阵对角线置为很小的值, 消除自身的影响
RuntimeError: cosine_similarity requires both inputs to have the same sizes, but x1 has [64, 1, 768] and x2 has [1, 64, 768]
请教一下这里有什么问题吗