Skip to content

Commit 8d123c0

Browse files
committed
Fix #7, remove path to codebook in reconstruction loss
1 parent cb4702a commit 8d123c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def forward(self, z_e_x):
8080

8181
def straight_through(self, z_e_x):
8282
z_e_x_ = z_e_x.permute(0, 2, 3, 1).contiguous()
83-
z_q_x_, indices = vq_st(z_e_x_, self.embedding.weight)
83+
z_q_x_, indices = vq_st(z_e_x_, self.embedding.weight.detach())
8484
z_q_x = z_q_x_.permute(0, 3, 1, 2).contiguous()
8585

8686
z_q_x_bar_flatten = torch.index_select(self.embedding.weight,

0 commit comments

Comments
 (0)