Skip to content

Commit 11569e0

Browse files
authored
Update dcgan_faces_tutorial.py
Update labels to be floats to work around torch.full inference change.
1 parent afede4c commit 11569e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

beginner_source/dcgan_faces_tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,8 @@ def forward(self, input):
493493
fixed_noise = torch.randn(64, nz, 1, 1, device=device)
494494

495495
# Establish convention for real and fake labels during training
496-
real_label = 1
497-
fake_label = 0
496+
real_label = 1.
497+
fake_label = 0.
498498

499499
# Setup Adam optimizers for both G and D
500500
optimizerD = optim.Adam(netD.parameters(), lr=lr, betas=(beta1, 0.999))

0 commit comments

Comments
 (0)