1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-09 12:30:38 +08:00

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

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2024-04-11 16:58:06 +09:00
committed by GitHub
parent 59e29a8dcd
commit 732e4a152d

View File

@@ -52,7 +52,13 @@ class TextEncoder(nn.Module):
) )
self.proj = nn.Conv1d(hidden_channels, out_channels * 2, 1) self.proj = nn.Conv1d(hidden_channels, out_channels * 2, 1)
def forward(self, phone: torch.Tensor, pitch: torch.Tensor, lengths: torch.Tensor, skip_head: Optional[torch.Tensor] = None): def forward(
self,
phone: torch.Tensor,
pitch: torch.Tensor,
lengths: torch.Tensor,
skip_head: Optional[torch.Tensor] = None,
):
if pitch is None: if pitch is None:
x = self.emb_phone(phone) x = self.emb_phone(phone)
else: else:
@@ -67,8 +73,8 @@ class TextEncoder(nn.Module):
if skip_head is not None: if skip_head is not None:
assert isinstance(skip_head, torch.Tensor) assert isinstance(skip_head, torch.Tensor)
head = int(skip_head.item()) head = int(skip_head.item())
x = x[:, :, head : ] x = x[:, :, head:]
x_mask = x_mask[:, :, head : ] x_mask = x_mask[:, :, head:]
stats = self.proj(x) * x_mask stats = self.proj(x) * x_mask
m, logs = torch.split(stats, self.out_channels, dim=1) m, logs = torch.split(stats, self.out_channels, dim=1)
return m, logs, x_mask return m, logs, x_mask