:param txt_tokens: [B, T] :return: { 'encoder_out': [T x B x C] }
(self, txt_tokens)
| 322 | ) |
| 323 | |
| 324 | def forward(self, txt_tokens): |
| 325 | """ |
| 326 | |
| 327 | :param txt_tokens: [B, T] |
| 328 | :return: { |
| 329 | 'encoder_out': [T x B x C] |
| 330 | } |
| 331 | """ |
| 332 | encoder_padding_mask = txt_tokens.eq(self.padding_idx).data |
| 333 | x = self.forward_embedding(txt_tokens) # [B, T, H] |
| 334 | x = super(FastspeechEncoder, self).forward(x, encoder_padding_mask) |
| 335 | return x |
| 336 | |
| 337 | def forward_embedding(self, txt_tokens): |
| 338 | # embed tokens and positions |
nothing calls this directly
no test coverage detected