MCPcopy Index your code
hub / github.com/MoonInTheRiver/DiffSinger / forward

Method forward

modules/fastspeech/pe.py:135–149  ·  view source on GitHub ↗
(self, mel_input=None)

Source from the content-addressed store, hash-verified

133 padding=hparams['ffn_padding'], kernel_size=hparams['predictor_kernel'])
134
135 def forward(self, mel_input=None):
136 ret = {}
137 mel_hidden = self.mel_prenet(mel_input)[1]
138 if self.conv_layers > 0:
139 mel_hidden = self.mel_encoder(mel_hidden)
140
141 ret['pitch_pred'] = pitch_pred = self.pitch_predictor(mel_hidden)
142
143 pitch_padding = mel_input.abs().sum(-1) == 0
144 use_uv = hparams['pitch_type'] == 'frame' and hparams['use_uv']
145
146 ret['f0_denorm_pred'] = denorm_f0(
147 pitch_pred[:, :, 0], (pitch_pred[:, :, 1] > 0) if use_uv else None,
148 hparams, pitch_padding=pitch_padding)
149 return ret

Callers

nothing calls this directly

Calls 1

denorm_f0Function · 0.90

Tested by

no test coverage detected