feat: 优化日志打印

This commit is contained in:
源文雨
2023-09-04 00:47:33 +08:00
parent 5a6f824537
commit 391dea85de
3 changed files with 23 additions and 10 deletions

View File

@@ -1,13 +1,14 @@
import copy
import math
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
import commons
import modules
from torch.nn.utils import weight_norm, remove_weight_norm
import logging
logger = logging.getLogger(__name__)
class LayerNorm(nn.Module):
def __init__(self, channels, eps=1e-5):
super().__init__()
@@ -55,7 +56,7 @@ class Encoder(nn.Module):
self.spk_emb_linear = nn.Linear(self.gin_channels, self.hidden_channels)
# vits2 says 3rd block, so idx is 2 by default
self.cond_layer_idx = kwargs['cond_layer_idx'] if 'cond_layer_idx' in kwargs else 2
print(self.gin_channels, self.cond_layer_idx)
logging.debug(self.gin_channels, self.cond_layer_idx)
assert self.cond_layer_idx < self.n_layers, 'cond_layer_idx should be less than n_layers'
self.drop = nn.Dropout(p_dropout)
self.attn_layers = nn.ModuleList()