Skip to content

Commit d62f788

Browse files
committed
fix bugs for data_loading_tutorial and dcgan_faces_tutorial
1 parent cca97f0 commit d62f788

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

beginner_source/data_loading_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def __call__(self, sample):
374374
#
375375

376376
dataloader = DataLoader(transformed_dataset, batch_size=4,
377-
shuffle=True, num_workers=4)
377+
shuffle=True, num_workers=0)
378378

379379

380380
# Helper function to show a batch

beginner_source/dcgan_faces_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ def forward(self, input):
591591
# Format batch
592592
real_cpu = data[0].to(device)
593593
b_size = real_cpu.size(0)
594-
label = torch.full((b_size,), real_label, device=device)
594+
label = torch.full((b_size,), real_label, dtype=torch.float, device=device)
595595
# Forward pass real batch through D
596596
output = netD(real_cpu).view(-1)
597597
# Calculate loss on all-real batch

0 commit comments

Comments
 (0)