From 5fd2feb4f1e4561a7951c2dee41aabd433b1c695 Mon Sep 17 00:00:00 2001 From: zzj <29055749+zjzh@users.noreply.github.com> Date: Fri, 21 Jan 2022 17:30:00 +0800 Subject: [PATCH] Update a3c.py refactoring code with For Else which is more pythonic, concise and efficient --- src/a3c.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/a3c.py b/src/a3c.py index fc0a7c7..362c0b8 100644 --- a/src/a3c.py +++ b/src/a3c.py @@ -231,7 +231,7 @@ def env_runner(env, policy, num_local_steps, summary_writer, render, predictor, if terminal_end: break - if not terminal_end: + else: rollout.r = policy.value(last_state, *last_features) # once we have enough experience, yield it, and have the ThreadRunner place it on a queue