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 (#144)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
f9ae0b5d32
commit
a3a69e8bd5
@@ -32,7 +32,7 @@ try:
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
if not ('GradScaler' in globals() and 'autocast' in globals()):
|
if not ("GradScaler" in globals() and "autocast" in globals()):
|
||||||
from torch.amp.grad_scaler import GradScaler
|
from torch.amp.grad_scaler import GradScaler
|
||||||
from torch.amp.autocast_mode import autocast
|
from torch.amp.autocast_mode import autocast
|
||||||
|
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ class PosteriorEncoder(nn.Module):
|
|||||||
|
|
||||||
def __prepare_scriptable__(self):
|
def __prepare_scriptable__(self):
|
||||||
from torch.nn.utils import parametrize
|
from torch.nn.utils import parametrize
|
||||||
|
|
||||||
if parametrize.is_parametrized(self.enc, "weight"):
|
if parametrize.is_parametrized(self.enc, "weight"):
|
||||||
parametrize.remove_parametrizations(self.enc, "weight")
|
parametrize.remove_parametrizations(self.enc, "weight")
|
||||||
return self
|
return self
|
||||||
|
|||||||
@@ -51,7 +51,9 @@ class WN(torch.nn.Module):
|
|||||||
cond_layer = torch.nn.Conv1d(
|
cond_layer = torch.nn.Conv1d(
|
||||||
gin_channels, 2 * hidden_channels * n_layers, 1
|
gin_channels, 2 * hidden_channels * n_layers, 1
|
||||||
)
|
)
|
||||||
self.cond_layer = torch.nn.utils.parametrizations.weight_norm(cond_layer, name="weight")
|
self.cond_layer = torch.nn.utils.parametrizations.weight_norm(
|
||||||
|
cond_layer, name="weight"
|
||||||
|
)
|
||||||
|
|
||||||
for i in range(n_layers):
|
for i in range(n_layers):
|
||||||
dilation = dilation_rate**i
|
dilation = dilation_rate**i
|
||||||
@@ -63,7 +65,9 @@ class WN(torch.nn.Module):
|
|||||||
dilation=dilation,
|
dilation=dilation,
|
||||||
padding=padding,
|
padding=padding,
|
||||||
)
|
)
|
||||||
in_layer = torch.nn.utils.parametrizations.weight_norm(in_layer, name="weight")
|
in_layer = torch.nn.utils.parametrizations.weight_norm(
|
||||||
|
in_layer, name="weight"
|
||||||
|
)
|
||||||
self.in_layers.append(in_layer)
|
self.in_layers.append(in_layer)
|
||||||
|
|
||||||
# last one is not necessary
|
# last one is not necessary
|
||||||
@@ -73,7 +77,9 @@ class WN(torch.nn.Module):
|
|||||||
res_skip_channels = hidden_channels
|
res_skip_channels = hidden_channels
|
||||||
|
|
||||||
res_skip_layer = torch.nn.Conv1d(hidden_channels, res_skip_channels, 1)
|
res_skip_layer = torch.nn.Conv1d(hidden_channels, res_skip_channels, 1)
|
||||||
res_skip_layer = torch.nn.utils.parametrizations.weight_norm(res_skip_layer, name="weight")
|
res_skip_layer = torch.nn.utils.parametrizations.weight_norm(
|
||||||
|
res_skip_layer, name="weight"
|
||||||
|
)
|
||||||
self.res_skip_layers.append(res_skip_layer)
|
self.res_skip_layers.append(res_skip_layer)
|
||||||
|
|
||||||
def __call__(
|
def __call__(
|
||||||
|
|||||||
Reference in New Issue
Block a user