MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / __init__

Method __init__

modules/fastspeech/pe.py:82–96  ·  view source on GitHub ↗
(self, idim=80, n_layers=5, n_chans=256, odim=32, kernel_size=5, norm='gn',
                 dropout=0, strides=None, res=True)

Source from the content-addressed store, hash-verified

80
81class ConvStacks(nn.Module):
82 def __init__(self, idim=80, n_layers=5, n_chans=256, odim=32, kernel_size=5, norm='gn',
83 dropout=0, strides=None, res=True):
84 super().__init__()
85 self.conv = torch.nn.ModuleList()
86 self.kernel_size = kernel_size
87 self.res = res
88 self.in_proj = Linear(idim, n_chans)
89 if strides is None:
90 strides = [1] * n_layers
91 else:
92 assert len(strides) == n_layers
93 for idx in range(n_layers):
94 self.conv.append(ConvBlock(
95 n_chans, n_chans, kernel_size, stride=strides[idx], norm=norm, dropout=dropout))
96 self.out_proj = Linear(n_chans, odim)
97
98 def forward(self, x, return_hiddens=False):
99 """

Callers

nothing calls this directly

Calls 3

LinearFunction · 0.85
ConvBlockClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected