MCPcopy Create free account
hub / github.com/pytorch/tutorials / dot_score

Method dot_score

beginner_source/chatbot_tutorial.py:756–757  ·  view source on GitHub ↗
(self, hidden, encoder_output)

Source from the content-addressed store, hash-verified

754 self.v = nn.Parameter(torch.FloatTensor(hidden_size))
755
756 def dot_score(self, hidden, encoder_output):
757 return torch.sum(hidden * encoder_output, dim=2)
758
759 def general_score(self, hidden, encoder_output):
760 energy = self.attn(encoder_output)

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected