MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / forward

Method forward

modules/fastspeech/tts_modules.py:324–335  ·  view source on GitHub ↗

:param txt_tokens: [B, T] :return: { 'encoder_out': [T x B x C] }

(self, txt_tokens)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

forward_embeddingMethod · 0.95
forwardMethod · 0.45

Tested by

no test coverage detected