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

Method forward

modules/fastspeech/tts_modules.py:222–235  ·  view source on GitHub ↗

:param xs: [B, T, H] :return: [B, T, H]

(self, xs)

Source from the content-addressed store, hash-verified

220 self.pos_embed_alpha = nn.Parameter(torch.Tensor([1]))
221
222 def forward(self, xs):
223 """
224
225 :param xs: [B, T, H]
226 :return: [B, T, H]
227 """
228 positions = self.pos_embed_alpha * self.embed_positions(xs[..., 0])
229 xs = xs + positions
230 xs = xs.transpose(1, -1) # (B, idim, Tmax)
231 for f in self.conv:
232 xs = f(xs) # (B, C, Tmax)
233 # NOTE: calculate in log domain
234 xs = self.linear(xs.transpose(1, -1)) # (B, Tmax, H)
235 return xs
236
237
238class EnergyPredictor(PitchPredictor):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected