MCPcopy Create free account
hub / github.com/Mew233/pairwise / forward

Method forward

pairwise/utilitis.py:432–440  ·  view source on GitHub ↗
(self, x, e_outputs, src_mask=None, trg_mask=None)

Source from the content-addressed store, hash-verified

430 self.ff = FeedForward(d_model, dropout=dropout)
431
432 def forward(self, x, e_outputs, src_mask=None, trg_mask=None):
433 x = F.relu(self.input_linear(x))
434 x2 = self.norm_1(x)
435 x = x + self.dropout_1(self.attn_1(x2, x2, x2, trg_mask))
436 x2 = self.norm_2(x)
437 x = x + self.dropout_2(self.attn_2(x2, e_outputs, e_outputs, src_mask))
438 x2 = self.norm_3(x)
439 x = x + self.dropout_3(self.ff(x2))
440 return x
441
442
443

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected