Skip to content

Commit

Permalink
compatibility: change gamma to weight (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
zly-idleness authored Oct 15, 2024
1 parent d54f4f4 commit b3d511b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ChatTTS/model/dvae.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(
) # pointwise/1x1 convs, implemented with linear layers
self.act = nn.GELU()
self.pwconv2 = nn.Linear(intermediate_dim, dim)
self.gamma = (
self.weight = (
nn.Parameter(layer_scale_init_value * torch.ones(dim), requires_grad=True)
if layer_scale_init_value > 0
else None
Expand All @@ -55,8 +55,8 @@ def forward(self, x: torch.Tensor, cond=None) -> torch.Tensor:
del y
y = self.pwconv2(x)
del x
if self.gamma is not None:
y *= self.gamma
if self.weight is not None:
y *= self.weight
y.transpose_(1, 2) # (B, T, C) -> (B, C, T)

x = y + residual
Expand Down

0 comments on commit b3d511b

Please sign in to comment.