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

Method forward

modules/fastspeech/tts_modules.py:48–56  ·  view source on GitHub ↗

Apply layer normalization. :param torch.Tensor x: input tensor :return: layer normalized tensor :rtype torch.Tensor

(self, x)

Source from the content-addressed store, hash-verified

46 self.dim = dim
47
48 def forward(self, x):
49 """Apply layer normalization.
50 :param torch.Tensor x: input tensor
51 :return: layer normalized tensor
52 :rtype torch.Tensor
53 """
54 if self.dim == -1:
55 return super(LayerNorm, self).forward(x)
56 return super(LayerNorm, self).forward(x.transpose(1, -1)).transpose(1, -1)
57
58
59class DurationPredictor(torch.nn.Module):

Callers 1

forwardMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected