Skip to content

F.cosine_similarity #9

Description

@jellyroger

---> 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]

请教一下这里有什么问题吗

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions