Skip to content

Commit 1735e5a

Browse files
author
Virginia Fernandez
committed
Fixed one pep8 error.
Signed-off-by: Virginia <[email protected]>
1 parent 5803d00 commit 1735e5a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

generation/2d_diffusion_autoencoder/2d_diffusion_autoencoder_tutorial.ipynb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,8 @@
492492
" # Create timesteps\n",
493493
" timesteps = torch.randint(0, inferer.scheduler.num_train_timesteps, (batch_size,)).to(device).long()\n",
494494
" # Get model prediction\n",
495-
" # cross attention expects shape [batch size, sequence length, channels], \n",
496-
" #we are use channels = latent dimension and sequence length = 1\n",
495+
" # cross attention expects shape [batch size, sequence length, channels],\n",
496+
" # we are use channels = latent dimension and sequence length = 1\n",
497497
" latent = model.semantic_encoder(images)\n",
498498
" noise_pred = inferer(\n",
499499
" inputs=images, diffusion_model=model.unet, noise=noise, timesteps=timesteps, condition=latent.unsqueeze(2)\n",
@@ -529,10 +529,11 @@
529529
" iter_loss_list.append(iter_loss / val_interval)\n",
530530
" val_iter_loss_list.append(val_iter_loss / len(val_loader))\n",
531531
" iter_loss = 0\n",
532-
" print(\n",
533-
" f\"Iteration {epoch} - Interval Loss {iter_loss_list[-1]:.4f}, \n",
534-
" Interval Loss Val {val_iter_loss_list[-1]:.4f}\"\n",
535-
" )\n",
532+
" to_print = [\n",
533+
" f\"Iteration {epoch} - Interval Loss {iter_loss_list[-1]:.4f}\",\n",
534+
" f\"Interval Loss Val {val_iter_loss_list[-1]:.4f}\",\n",
535+
" ]\n",
536+
" print(\"\".join(to_print))\n",
536537
"\n",
537538
"total_time = time.time() - total_start\n",
538539
"\n",

0 commit comments

Comments
 (0)