MCPcopy Create free account
hub / github.com/HKUDS/PromptMM / sim

Method sim

codes/Models.py:66–69  ·  view source on GitHub ↗
(self, z1, z2)

Source from the content-addressed store, hash-verified

64 else:
65 return torch.mm(x, y)
66 def sim(self, z1, z2):
67 z1 = F.normalize(z1)
68 z2 = F.normalize(z2)
69 return torch.mm(z1, z2.t())
70
71 def batched_contrastive_loss(self, z1, z2, batch_size=4096):
72 device = z1.device

Callers 1

Calls 1

mmMethod · 0.45

Tested by

no test coverage detected