diff --git a/rvc/lib/algorithm/generators/hifigan.py b/rvc/lib/algorithm/generators/hifigan.py index cbb6f900..1f18dfac 100644 --- a/rvc/lib/algorithm/generators/hifigan.py +++ b/rvc/lib/algorithm/generators/hifigan.py @@ -73,7 +73,7 @@ def __init__( def forward(self, x: torch.Tensor, g: Optional[torch.Tensor] = None): # new tensor x = self.conv_pre(x) - + if g is not None: # in-place call x += self.cond(g) diff --git a/rvc/lib/algorithm/residuals.py b/rvc/lib/algorithm/residuals.py index 98424365..df7d544d 100644 --- a/rvc/lib/algorithm/residuals.py +++ b/rvc/lib/algorithm/residuals.py @@ -26,9 +26,11 @@ def create_conv1d_layer(channels, kernel_size, dilation): def apply_mask(tensor: torch.Tensor, mask: Optional[torch.Tensor]): return tensor * mask if mask else tensor + def apply_mask_(tensor: torch.Tensor, mask: Optional[torch.Tensor]): return tensor.mul_(mask) if mask else tensor + class ResBlock(torch.nn.Module): """ A residual block module that applies a series of 1D convolutional layers with residual connections.