(self, d_model, d_inner, n_head, d_k, d_v, dropout=0.1)
| 50 | ''' Compose with two layers ''' |
| 51 | |
| 52 | def __init__(self, d_model, d_inner, n_head, d_k, d_v, dropout=0.1): |
| 53 | super(EncoderLayer, self).__init__() |
| 54 | self.slf_attn = MultiHeadAttention( |
| 55 | n_head, d_model, d_k, d_v, dropout=dropout) |
| 56 | self.pos_ffn = PositionwiseFeedForward(d_model, d_inner, dropout=dropout) |
| 57 | |
| 58 | def forward(self, enc_input, non_pad_mask=None, slf_attn_mask=None): |
| 59 | enc_output, enc_slf_attn = self.slf_attn( |
no test coverage detected