Skip to content

Commit b3d4518

Browse files
fix a bug when not using ipython
1 parent 0c252e6 commit b3d4518

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

intermediate_source/reinforcement_q_learning.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,12 @@ def plot_durations(show_result=False):
315315
plt.plot(means.numpy())
316316

317317
plt.pause(0.001) # pause a bit so that plots are updated
318-
if is_ipython and not show_result:
319-
display.display(plt.gcf())
320-
display.clear_output(wait=True)
321-
else:
322-
display.display(plt.gcf())
318+
if is_ipython:
319+
if not show_result:
320+
display.display(plt.gcf())
321+
display.clear_output(wait=True)
322+
else:
323+
display.display(plt.gcf())
323324

324325

325326
######################################################################

0 commit comments

Comments
 (0)