1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-05 01:10:22 +08:00

chore(format): run black on dev (#94)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2024-11-28 03:21:10 +09:00
committed by GitHub
parent a8783c6639
commit d3add81469
10 changed files with 126 additions and 47 deletions

View File

@@ -166,9 +166,11 @@ class SineGenerator(torch.nn.Module):
rad = f0 / self.sampling_rate * a
rad2 = torch.fmod(rad[:, :-1, -1:].float() + 0.5, 1.0) - 0.5
rad_acc = rad2.cumsum(dim=1).fmod(1.0).to(f0)
rad += F.pad(rad_acc, (0, 0, 1, 0), mode='constant')
rad += F.pad(rad_acc, (0, 0, 1, 0), mode="constant")
rad = rad.reshape(f0.shape[0], -1, 1)
b = torch.arange(1, self.dim + 1, dtype=f0.dtype, device=f0.device).reshape(1, 1, -1)
b = torch.arange(1, self.dim + 1, dtype=f0.dtype, device=f0.device).reshape(
1, 1, -1
)
rad *= b
rand_ini = torch.rand(1, 1, self.dim, device=f0.device)
rand_ini[..., 0] = 0