Skip to content

Commit fc2881c

Browse files
committed
for backward compatibility, only fix if legacy=True is explicitly specified
1 parent 61774df commit fc2881c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

taming/modules/vqvae/quantize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def forward(self, z):
7070
# ......\end......... (TODO)
7171

7272
# compute loss for embedding
73-
loss = self.beta * torch.mean((z_q.detach()-z)**2) + \
73+
loss = torch.mean((z_q.detach()-z)**2) + self.beta * \
7474
torch.mean((z_q - z.detach()) ** 2)
7575

7676
# preserve gradients

0 commit comments

Comments
 (0)