Skip to content

Commit

Permalink
Runner requires manual call to close() so calling-code can work with …
Browse files Browse the repository at this point in the history
…"dirty" runner
  • Loading branch information
lefnire committed Jan 13, 2018
1 parent 07344b8 commit bda3e66
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tensorforce/execution/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ def reset(self, history=None):
self.episode_timesteps = history.get('episode_timesteps', list())
self.episode_times = history.get('episode_times', list())

def close(self):
self.agent.close()
self.environment.close()

def run(
self,
timesteps=None,
Expand Down Expand Up @@ -147,6 +151,3 @@ def run(
self.agent.should_stop():
# agent.episode / agent.timestep are globally updated
break

self.agent.close()
self.environment.close()

0 comments on commit bda3e66

Please sign in to comment.