Skip to content

Commit 61764f9

Browse files
authored
Add "flush=True" to progress-bar print statements
Due to terminal I/O buffering, the dots came out in batches when without the "flush=True" argument. This was confusing, and defeats the purpose of the dots being a progress bar for inexperienced users.
1 parent 0d6bb26 commit 61764f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

site/en/tutorials/generative/style_transfer.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@
902902
" for m in range(steps_per_epoch):\n",
903903
" step += 1\n",
904904
" train_step(image)\n",
905-
" print(\".\", end='')\n",
905+
" print(\".\", end='', flush=True)\n",
906906
" display.clear_output(wait=True)\n",
907907
" display.display(tensor_to_image(image))\n",
908908
" print(\"Train step: {}\".format(step))\n",
@@ -1171,7 +1171,7 @@
11711171
" for m in range(steps_per_epoch):\n",
11721172
" step += 1\n",
11731173
" train_step(image)\n",
1174-
" print(\".\", end='')\n",
1174+
" print(\".\", end='', flush=True)\n",
11751175
" display.clear_output(wait=True)\n",
11761176
" display.display(tensor_to_image(image))\n",
11771177
" print(\"Train step: {}\".format(step))\n",

0 commit comments

Comments
 (0)