MCPcopy Create free account
hub / github.com/LUMIA-Group/MemoryDecoder / dotprod

Method dotprod

knn_utils/saveEmbedMulti.py:227–231  ·  view source on GitHub ↗
(query, keys)

Source from the content-addressed store, hash-verified

225
226 @staticmethod
227 def dotprod(query, keys):
228 # query: (batch, beams, dim)
229 # keys: (batch, 1, time, dim)
230 # returns: (batch, beams, time)
231 return torch.sum((query.unsqueeze(-2) * keys), dim=-1)
232
233
234 @staticmethod

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected